diff options
Diffstat (limited to 'modules/desktop/waybar')
| -rw-r--r-- | modules/desktop/waybar/bar/main.nix | 3 | ||||
| -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 | ||||
| -rw-r--r-- | modules/desktop/waybar/style.nix | 43 |
13 files changed, 103 insertions, 35 deletions
diff --git a/modules/desktop/waybar/bar/main.nix b/modules/desktop/waybar/bar/main.nix index fbbfd87..a52c49b 100644 --- a/modules/desktop/waybar/bar/main.nix +++ b/modules/desktop/waybar/bar/main.nix @@ -5,6 +5,9 @@ with config.scheme.withHashtag; position = "top"; height = 30; + fixed-center = false; + expand-center = true; + modules-left = [ "hyprland/workspaces" ]; modules-center = [ "hyprland/window" ]; modules-right = [ 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}"; } diff --git a/modules/desktop/waybar/style.nix b/modules/desktop/waybar/style.nix index 319b94f..5ec8070 100644 --- a/modules/desktop/waybar/style.nix +++ b/modules/desktop/waybar/style.nix @@ -7,23 +7,52 @@ with config.scheme.withHashtag; font-family: "${config.fonts.normal}"; font-size: ${toString config.fonts.size}px; min-height: 0; + margin: 0; + padding: 0; } - window#waybar { + #workspaces, #window, #pulseaudio, #battery, #custom-vpn, #network, + #clock.time, #memory, #cpu, #clock.date { background: ${base00}; - color: ${base05}; + margin: 0 2px; + } + + #workspaces { + border: none; + margin-left: 2.5px; + } + + #clock.date { + margin-right: 4.5px; + } + + #window, #pulseaudio, #battery, #custom-vpn, #network, + #clock.time, #memory, #cpu, #clock.date { + border: 1.5px solid ${base03}; + color: ${base07}; + padding: 0 8px; } #workspaces button { - padding: 0 4px; - color: ${base05}; + padding: 3px; + color: ${base07}; + border: 1.5px solid ${base03}; + border-radius: 0; + min-width: 24px; + min-height: 24px; + margin: 0 2px; + } + + #workspaces button:hover { + background: ${base01}; } - #workspaces button.focused { - border-bottom: 3px solid ${base0D}; + #workspaces button.active { + background: ${base03}; } #workspaces button.urgent { - border-bottom: 3px solid ${base08}; + background: ${base08}; + border-color: ${base08}; } '' |
