diff options
Diffstat (limited to 'accounts/gkleen@sif/niri/waybar.nix')
-rw-r--r-- | accounts/gkleen@sif/niri/waybar.nix | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/accounts/gkleen@sif/niri/waybar.nix b/accounts/gkleen@sif/niri/waybar.nix index 79c429f8..3f1f8119 100644 --- a/accounts/gkleen@sif/niri/waybar.nix +++ b/accounts/gkleen@sif/niri/waybar.nix | |||
@@ -1,5 +1,7 @@ | |||
1 | { lib, pkgs, ... }: | 1 | { lib, config, pkgs, ... }: |
2 | { | 2 | let |
3 | swayosd-client = lib.getExe' config.services.swayosd.package "swayosd-client"; | ||
4 | in { | ||
3 | config = { | 5 | config = { |
4 | programs.waybar = { | 6 | programs.waybar = { |
5 | enable = true; | 7 | enable = true; |
@@ -22,7 +24,7 @@ | |||
22 | output = [ "eDP-1" "DP-2" "DP-3" ]; | 24 | output = [ "eDP-1" "DP-2" "DP-3" ]; |
23 | modules-left = [ "niri/workspaces" ]; | 25 | modules-left = [ "niri/workspaces" ]; |
24 | modules-center = [ "niri/window" ]; | 26 | modules-center = [ "niri/window" ]; |
25 | modules-right = [ # "custom/worktime" "custom/worktime-today" | 27 | modules-right = [ "custom/worktime" "custom/worktime-today" |
26 | "custom/weather" | 28 | "custom/weather" |
27 | "custom/keymap" | 29 | "custom/keymap" |
28 | "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "custom/mako" "clock" ]; | 30 | "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "custom/mako" "clock" ]; |
@@ -59,7 +61,7 @@ | |||
59 | text = f"<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>" # noqa: E501 | 61 | text = f"<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>" # noqa: E501 |
60 | if is_silent: | 62 | if is_silent: |
61 | text = f"<span color=\"#ffffff\">{text}</span>" | 63 | text = f"<span color=\"#ffffff\">{text}</span>" |
62 | print(json.dumps({'text': text}, separators=(',', ':')), flush=True) # noqa: E501 | 64 | print(json.dumps({'text': text, 'tooltip': ', '.join(modes)}, separators=(',', ':')), flush=True) # noqa: E501 |
63 | 65 | ||
64 | async def on_properties_changed(interface_name, changed_properties, invalidated_properties): # noqa: E501 | 66 | async def on_properties_changed(interface_name, changed_properties, invalidated_properties): # noqa: E501 |
65 | if "Modes" not in invalidated_properties: | 67 | if "Modes" not in invalidated_properties: |
@@ -120,16 +122,16 @@ | |||
120 | }; | 122 | }; |
121 | "custom/worktime" = { | 123 | "custom/worktime" = { |
122 | interval = 60; | 124 | interval = 60; |
123 | exec = lib.getExe pkgs.worktime; | 125 | exec = "${lib.getExe pkgs.worktime} time --waybar"; |
124 | tooltip = false; | 126 | return-type = "json"; |
125 | }; | 127 | }; |
126 | "custom/worktime-today" = { | 128 | "custom/worktime-today" = { |
127 | interval = 60; | 129 | interval = 60; |
128 | exec = "${lib.getExe pkgs.worktime} today"; | 130 | exec = "${lib.getExe pkgs.worktime} today --waybar"; |
129 | tooltip = false; | 131 | return-type = "json"; |
130 | }; | 132 | }; |
131 | "niri/workspaces" = { | 133 | "niri/workspaces" = { |
132 | ignore = ["pwctl" "kpxc" "bmgr" "edit" "term"]; | 134 | ignore = ["eff" "pwctl" "kpxc" "bmgr" "edit" "term"]; |
133 | }; | 135 | }; |
134 | "niri/window" = { | 136 | "niri/window" = { |
135 | separate-outputs = true; | 137 | separate-outputs = true; |
@@ -190,8 +192,8 @@ | |||
190 | icon-size = iconSize; | 192 | icon-size = iconSize; |
191 | tooltip-format = "{percent}%"; | 193 | tooltip-format = "{percent}%"; |
192 | format-icons = ["󰃚" "󰃛" "󰃜" "󰃝" "󰃞" "󰃟" "󰃠"]; | 194 | format-icons = ["󰃚" "󰃛" "󰃜" "󰃝" "󰃞" "󰃟" "󰃠"]; |
193 | on-scroll-up = "lightctl -d -e4 -n1 up"; | 195 | on-scroll-up = "${swayosd-client} --brightness raise"; |
194 | on-scroll-down = "lightctl -d -e4 -n1 down"; | 196 | on-scroll-down = "${swayosd-client} --brightness lower"; |
195 | }; | 197 | }; |
196 | wireplumber = { | 198 | wireplumber = { |
197 | format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>"; | 199 | format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>"; |
@@ -200,9 +202,9 @@ | |||
200 | format-icons = ["󰕿" "󰖀" "󰕾"]; | 202 | format-icons = ["󰕿" "󰖀" "󰕾"]; |
201 | format-muted = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">󰝟</span>"; | 203 | format-muted = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">󰝟</span>"; |
202 | # ignored-sinks = ["Easy Effects Sink"]; | 204 | # ignored-sinks = ["Easy Effects Sink"]; |
203 | on-scroll-up = "volumectl -d -u up"; | 205 | on-scroll-up = "${swayosd-client} --output-volume raise"; |
204 | on-scroll-down = "volumectl -d -u down"; | 206 | on-scroll-down = "${swayosd-client} --output-volume lower"; |
205 | on-click = "volumectl -d toggle-mute"; | 207 | on-click = "${swayosd-client} --output-volume mute-toggle"; |
206 | }; | 208 | }; |
207 | } | 209 | } |
208 | { | 210 | { |
@@ -241,7 +243,7 @@ | |||
241 | 243 | ||
242 | * { | 244 | * { |
243 | border: none; | 245 | border: none; |
244 | font-family: "Fira Sans Nerd Font"; | 246 | font-family: "Fira Sans"; |
245 | font-size: 10pt; | 247 | font-size: 10pt; |
246 | min-height: 0; | 248 | min-height: 0; |
247 | } | 249 | } |
@@ -252,10 +254,10 @@ | |||
252 | } | 254 | } |
253 | 255 | ||
254 | .modules-left { | 256 | .modules-left { |
255 | margin-left: 8px; | 257 | margin-left: 12px; |
256 | } | 258 | } |
257 | .modules-right { | 259 | .modules-right { |
258 | margin-right: 8px; | 260 | margin-right: 12px; |
259 | } | 261 | } |
260 | 262 | ||
261 | .module { | 263 | .module { |
@@ -280,11 +282,12 @@ | |||
280 | color: @grey; | 282 | color: @grey; |
281 | margin: 0 5px; | 283 | margin: 0 5px; |
282 | } | 284 | } |
283 | #custom-weather, #custom-worktime-today { | 285 | #custom-weather { |
284 | margin-right: 3px; | 286 | margin-right: 3px; |
285 | } | 287 | } |
286 | #custom-keymap, #custom-weather { | 288 | #custom-keymap { |
287 | margin-left: 3px; | 289 | margin-left: 3px; |
290 | margin-right: 3px; | ||
288 | } | 291 | } |
289 | 292 | ||
290 | #tray { | 293 | #tray { |
@@ -320,6 +323,12 @@ | |||
320 | #idle_inhibitor.activated { | 323 | #idle_inhibitor.activated { |
321 | color: @white; | 324 | color: @white; |
322 | } | 325 | } |
326 | #custom-worktime.running, #custom-worktime-today.running { | ||
327 | color: @white; | ||
328 | } | ||
329 | #custom-worktime.over, #custom-worktime-today.over { | ||
330 | color: @orange; | ||
331 | } | ||
323 | 332 | ||
324 | #idle_inhibitor { | 333 | #idle_inhibitor { |
325 | padding-top: 1px; | 334 | padding-top: 1px; |
@@ -327,7 +336,7 @@ | |||
327 | 336 | ||
328 | #privacy { | 337 | #privacy { |
329 | color: @red; | 338 | color: @red; |
330 | margin: -1px 2px 0px 5px; | 339 | margin: -1px 4px 0px 3px; |
331 | } | 340 | } |
332 | #clock { | 341 | #clock { |
333 | /* margin-right: 5px; */ | 342 | /* margin-right: 5px; */ |