diff options
Diffstat (limited to 'modules/desktop/waybar/module')
| -rw-r--r-- | modules/desktop/waybar/module/battery.nix | 13 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/cpu.nix | 7 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/date.nix | 7 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/default.nix | 48 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/memory.nix | 7 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/network.nix | 11 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/time.nix | 7 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/volume.nix | 9 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/vpn.nix | 5 |
9 files changed, 61 insertions, 53 deletions
diff --git a/modules/desktop/waybar/module/battery.nix b/modules/desktop/waybar/module/battery.nix index e9b8186..05ae449 100644 --- a/modules/desktop/waybar/module/battery.nix +++ b/modules/desktop/waybar/module/battery.nix @@ -1,9 +1,12 @@ -{ config, iconColor }: +{ config, mkIcon }: with config.scheme.withHashtag; +let + iconColor = base09; +in { - format = "<span foreground='${iconColor}'>{icon}</span> {capacity}%"; - format-charging = "<span foreground='${iconColor}'></span> {capacity}%"; - format-plugged = "<span foreground='${iconColor}'></span> {capacity}%"; + format = "${mkIcon iconColor "{icon}"} {capacity}%"; + format-charging = "${mkIcon iconColor ""} {capacity}%"; + format-plugged = "${mkIcon iconColor ""} {capacity}%"; format-alt = "{time} {icon}"; format-icons = [ "" @@ -13,7 +16,7 @@ with config.scheme.withHashtag; "" "" "" - "" + "" "" "" ]; diff --git a/modules/desktop/waybar/module/cpu.nix b/modules/desktop/waybar/module/cpu.nix index 3b91c2b..d366f44 100644 --- a/modules/desktop/waybar/module/cpu.nix +++ b/modules/desktop/waybar/module/cpu.nix @@ -1,6 +1,9 @@ -{ config, iconColor }: +{ config, mkIcon }: with config.scheme.withHashtag; +let + iconColor = base0D; +in { - format = "<span foreground='${iconColor}'></span> {usage}%"; + format = "${mkIcon iconColor ""} {usage}%"; interval = 2; } diff --git a/modules/desktop/waybar/module/date.nix b/modules/desktop/waybar/module/date.nix index 477022e..5d21e68 100644 --- a/modules/desktop/waybar/module/date.nix +++ b/modules/desktop/waybar/module/date.nix @@ -1,7 +1,10 @@ -{ config, iconColor }: +{ config, mkIcon }: with config.scheme.withHashtag; +let + iconColor = base0E; +in { - format = "<span foreground='${iconColor}'></span> {:%d/%m/%Y}"; + format = "${mkIcon iconColor ""} {:%d/%m/%Y}"; tooltip-format = "{:%A, %d/%m/%Y}"; interval = 60; } diff --git a/modules/desktop/waybar/module/default.nix b/modules/desktop/waybar/module/default.nix index ee2918a..016ebd2 100644 --- a/modules/desktop/waybar/module/default.nix +++ b/modules/desktop/waybar/module/default.nix @@ -4,41 +4,27 @@ pkgs, }: with config.scheme.withHashtag; +let + inherit (import ../lib.nix { inherit lib; }) mkIcon; +in { mainBar = { "hyprland/workspaces" = import ./workspaces.nix { inherit config lib; }; "hyprland/window" = import ./window.nix { inherit config; }; - "pulseaudio" = import ./volume.nix { - inherit config; - iconColor = base0A; - }; - "battery" = import ./battery.nix { - inherit config; - iconColor = base09; - }; + "pulseaudio" = import ./volume.nix { inherit config mkIcon; }; + "battery" = import ./battery.nix { inherit config mkIcon; }; "custom/vpn" = import ./vpn.nix { - inherit config lib pkgs; - iconColor = base0C; - }; - "network" = import ./network.nix { - inherit config; - iconColor = base0B; - }; - "clock#time" = import ./time.nix { - inherit config; - iconColor = base08; - }; - "memory" = import ./memory.nix { - inherit config; - iconColor = base0F; - }; - "cpu" = import ./cpu.nix { - inherit config; - iconColor = base0D; - }; - "clock#date" = import ./date.nix { - inherit config; - iconColor = base0E; - }; + inherit + config + lib + pkgs + mkIcon + ; + }; + "network" = import ./network.nix { inherit config mkIcon; }; + "clock#time" = import ./time.nix { inherit config mkIcon; }; + "memory" = import ./memory.nix { inherit config mkIcon; }; + "cpu" = import ./cpu.nix { inherit config mkIcon; }; + "clock#date" = import ./date.nix { inherit config mkIcon; }; }; } diff --git a/modules/desktop/waybar/module/memory.nix b/modules/desktop/waybar/module/memory.nix index 3aa49d6..40e313f 100644 --- a/modules/desktop/waybar/module/memory.nix +++ b/modules/desktop/waybar/module/memory.nix @@ -1,6 +1,9 @@ -{ config, iconColor }: +{ config, mkIcon }: with config.scheme.withHashtag; +let + iconColor = base0F; +in { - format = "<span foreground='${iconColor}'></span> {percentage}%"; + format = "${mkIcon iconColor ""} {percentage}%"; interval = 2; } diff --git a/modules/desktop/waybar/module/network.nix b/modules/desktop/waybar/module/network.nix index fb1e836..7f0af4c 100644 --- a/modules/desktop/waybar/module/network.nix +++ b/modules/desktop/waybar/module/network.nix @@ -1,11 +1,14 @@ -{ config, iconColor }: +{ config, mkIcon }: with config.scheme.withHashtag; +let + iconColor = base0B; +in { interval = 2; - format-wifi = "<span foreground='${iconColor}'>{icon}</span> {bandwidthDownBytes} {bandwidthUpBytes}"; - format-ethernet = "<span foreground='${iconColor}'></span> {bandwidthDownBytes} {bandwidthUpBytes}"; - format-disconnected = "<span foreground='${iconColor}'></span> Disconnected"; + format-wifi = "${mkIcon iconColor "{icon}"} {bandwidthDownBytes} {bandwidthUpBytes}"; + format-ethernet = "${mkIcon iconColor ""} {bandwidthDownBytes} {bandwidthUpBytes}"; + format-disconnected = "${mkIcon iconColor ""} Disconnected"; tooltip-format = "{ifname}"; tooltip-format-wifi = "{essid} ({signalStrength}%)"; diff --git a/modules/desktop/waybar/module/time.nix b/modules/desktop/waybar/module/time.nix index fe6be26..f877674 100644 --- a/modules/desktop/waybar/module/time.nix +++ b/modules/desktop/waybar/module/time.nix @@ -1,7 +1,10 @@ -{ config, iconColor }: +{ config, mkIcon }: with config.scheme.withHashtag; +let + iconColor = base08; +in { - format = "<span foreground='${iconColor}'></span> {:%I:%M %p}"; + format = "${mkIcon iconColor ""} {:%I:%M %p}"; tooltip-format = "{:%H:%M:%S}"; interval = 30; } diff --git a/modules/desktop/waybar/module/volume.nix b/modules/desktop/waybar/module/volume.nix index fb57a16..0aa2b94 100644 --- a/modules/desktop/waybar/module/volume.nix +++ b/modules/desktop/waybar/module/volume.nix @@ -1,8 +1,11 @@ -{ config, iconColor }: +{ config, mkIcon }: with config.scheme.withHashtag; +let + iconColor = base0A; +in { - format = "<span foreground='${iconColor}'>{icon}</span> {volume}%"; - format-muted = "<span foreground='${iconColor}'></span>"; + format = "${mkIcon iconColor "{icon}"} {volume}%"; + format-muted = mkIcon iconColor " "; format-icons = [ "" "" diff --git a/modules/desktop/waybar/module/vpn.nix b/modules/desktop/waybar/module/vpn.nix index 52f41d4..aa74499 100644 --- a/modules/desktop/waybar/module/vpn.nix +++ b/modules/desktop/waybar/module/vpn.nix @@ -2,13 +2,14 @@ config, lib, pkgs, - iconColor, + mkIcon, }: with config.scheme.withHashtag; let + iconColor = base0C; vpnCheckScript = pkgs.writeShellScript "vpn-check" '' if ${lib.getExe' pkgs.iproute2 "ip"} a | ${lib.getExe pkgs.gnugrep} -q tun0; then - printf '<span foreground="${iconColor}"></span> VPN' + printf '${mkIcon iconColor ""} VPN' fi ''; in |
