diff options
Diffstat (limited to 'modules/desktop/waybar/module')
| -rw-r--r-- | modules/desktop/waybar/module/battery.nix | 8 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/cpu.nix | 4 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/date.nix | 4 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/default.nix | 41 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/memory.nix | 4 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/network.nix | 6 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/time.nix | 4 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/volume.nix | 6 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/vpn.nix | 10 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/window.nix | 2 | ||||
| -rw-r--r-- | modules/desktop/waybar/module/workspaces.nix | 3 |
11 files changed, 64 insertions, 28 deletions
diff --git a/modules/desktop/waybar/module/battery.nix b/modules/desktop/waybar/module/battery.nix index bf3527c..ec14b8b 100644 --- a/modules/desktop/waybar/module/battery.nix +++ b/modules/desktop/waybar/module/battery.nix @@ -1,9 +1,9 @@ -{ config }: +{ config, iconColor }: with config.scheme.withHashtag; { - format = "{icon} {capacity}%"; - format-charging = " {capacity}%"; - format-plugged = " {capacity}%"; + format = "<span foreground='${iconColor}'>{icon}</span> {capacity}%"; + format-charging = "<span foreground='${iconColor}'></span> {capacity}%"; + format-plugged = "<span foreground='${iconColor}'></span> {capacity}%"; format-alt = "{time} {icon}"; format-icons = [ "" diff --git a/modules/desktop/waybar/module/cpu.nix b/modules/desktop/waybar/module/cpu.nix index 06f5af6..cde77e6 100644 --- a/modules/desktop/waybar/module/cpu.nix +++ b/modules/desktop/waybar/module/cpu.nix @@ -1,6 +1,6 @@ -{ config }: +{ config, iconColor }: with config.scheme.withHashtag; { - format = " {usage}%"; + format = "<span foreground='${iconColor}'></span> {usage}%"; interval = 2; } diff --git a/modules/desktop/waybar/module/date.nix b/modules/desktop/waybar/module/date.nix index efdccc4..39716db 100644 --- a/modules/desktop/waybar/module/date.nix +++ b/modules/desktop/waybar/module/date.nix @@ -1,6 +1,6 @@ -{ config }: +{ config, iconColor }: with config.scheme.withHashtag; { - format = " {:%d/%m/%Y}"; + format = "<span foreground='${iconColor}'></span> {:%d/%m/%Y}"; interval = 60; } diff --git a/modules/desktop/waybar/module/default.nix b/modules/desktop/waybar/module/default.nix index 2fa6ef8..628b534 100644 --- a/modules/desktop/waybar/module/default.nix +++ b/modules/desktop/waybar/module/default.nix @@ -3,17 +3,42 @@ lib, pkgs, }: +with config.scheme.withHashtag; { mainBar = { "hyprland/workspaces" = import ./workspaces.nix { inherit config; }; "hyprland/window" = import ./window.nix { inherit config; }; - "pulseaudio" = import ./volume.nix { inherit config; }; - "battery" = import ./battery.nix { inherit config; }; - "custom/vpn" = import ./vpn.nix { inherit config lib pkgs; }; - "network" = import ./network.nix { inherit config; }; - "clock#time" = import ./time.nix { inherit config; }; - "memory" = import ./memory.nix { inherit config; }; - "cpu" = import ./cpu.nix { inherit config; }; - "clock#date" = import ./date.nix { inherit config; }; + "pulseaudio" = import ./volume.nix { + inherit config; + iconColor = base0A; + }; + "battery" = import ./battery.nix { + inherit config; + iconColor = base09; + }; + "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; + }; }; } diff --git a/modules/desktop/waybar/module/memory.nix b/modules/desktop/waybar/module/memory.nix index b9a45a4..27b66e0 100644 --- a/modules/desktop/waybar/module/memory.nix +++ b/modules/desktop/waybar/module/memory.nix @@ -1,6 +1,6 @@ -{ config }: +{ config, iconColor }: with config.scheme.withHashtag; { - format = " {usedGb} GB"; + format = "<span foreground='${iconColor}'></span> {percentage}%"; interval = 2; } diff --git a/modules/desktop/waybar/module/network.nix b/modules/desktop/waybar/module/network.nix index e1036ed..4e14d69 100644 --- a/modules/desktop/waybar/module/network.nix +++ b/modules/desktop/waybar/module/network.nix @@ -1,8 +1,8 @@ -{ config }: +{ config, iconColor }: with config.scheme.withHashtag; { - format-wifi = "{icon} {signalStrength}%"; - format-ethernet = " {ipaddr}"; + format-wifi = "<span foreground='${iconColor}'>{icon}</span> {signalStrength}%"; + format-ethernet = "<span foreground='${iconColor}'></span> {ipaddr}"; format-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 e097c9c..f7c578d 100644 --- a/modules/desktop/waybar/module/time.nix +++ b/modules/desktop/waybar/module/time.nix @@ -1,6 +1,6 @@ -{ config }: +{ config, iconColor }: with config.scheme.withHashtag; { - format = " {:%I:%M %p}"; + format = "<span foreground='${iconColor}'></span> {:%I:%M %p}"; interval = 30; } diff --git a/modules/desktop/waybar/module/volume.nix b/modules/desktop/waybar/module/volume.nix index ee3f2f3..cc074a7 100644 --- a/modules/desktop/waybar/module/volume.nix +++ b/modules/desktop/waybar/module/volume.nix @@ -1,8 +1,8 @@ -{ config }: +{ config, iconColor }: with config.scheme.withHashtag; { - format = "{icon} {volume}%"; - format-muted = ""; + format = "<span foreground='${iconColor}'>{icon}</span> {volume}%"; + format-muted = "<span foreground='${iconColor}'></span>"; format-icons = [ "" "" diff --git a/modules/desktop/waybar/module/vpn.nix b/modules/desktop/waybar/module/vpn.nix index 04366e1..bb0a242 100644 --- a/modules/desktop/waybar/module/vpn.nix +++ b/modules/desktop/waybar/module/vpn.nix @@ -2,10 +2,18 @@ config, lib, pkgs, + iconColor, }: with config.scheme.withHashtag; +let + 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' + fi + ''; +in { - exec = "${pkgs.runtimeShell} -c '${lib.getExe' pkgs.iproute2 "ip"} a | ${lib.getExe pkgs.gnugrep} -q tun0 && printf \" VPN\"'"; + exec = "${vpnCheckScript}"; interval = 5; format = "{}"; } diff --git a/modules/desktop/waybar/module/window.nix b/modules/desktop/waybar/module/window.nix index c4e54c3..0e708c2 100644 --- a/modules/desktop/waybar/module/window.nix +++ b/modules/desktop/waybar/module/window.nix @@ -1,5 +1,5 @@ { config }: with config.scheme.withHashtag; { - max-length = 20; + expand = true; } diff --git a/modules/desktop/waybar/module/workspaces.nix b/modules/desktop/waybar/module/workspaces.nix index bb5a6ee..d2b0290 100644 --- a/modules/desktop/waybar/module/workspaces.nix +++ b/modules/desktop/waybar/module/workspaces.nix @@ -2,5 +2,8 @@ with config.scheme.withHashtag; { format = "{name}"; + persistent-workspaces = { + "*" = 10; + }; on-click = "hyprctl dispatch workspace {name}"; } |
