diff options
Diffstat (limited to 'accounts/gkleen@sif/niri/waybar.nix')
-rw-r--r-- | accounts/gkleen@sif/niri/waybar.nix | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/accounts/gkleen@sif/niri/waybar.nix b/accounts/gkleen@sif/niri/waybar.nix index c3820508..c02a9a76 100644 --- a/accounts/gkleen@sif/niri/waybar.nix +++ b/accounts/gkleen@sif/niri/waybar.nix | |||
@@ -20,15 +20,21 @@ in { | |||
20 | { | 20 | { |
21 | layer = "top"; | 21 | layer = "top"; |
22 | position = "top"; | 22 | position = "top"; |
23 | height = 14; | 23 | height = 21; |
24 | output = [ "eDP-1" "DP-2" "DP-3" ]; | 24 | output = [ "eDP-1" "DP-2" "DP-3" ]; |
25 | modules-left = [ "niri/workspaces" ]; | 25 | modules-left = [ "niri/workspaces" ]; |
26 | modules-center = [ "niri/window" ]; | 26 | modules-center = [ "niri/window" ]; |
27 | modules-right = [ "custom/worktime" "custom/worktime-today" | 27 | modules-right = [ "custom/worktime" "custom/worktime-today" |
28 | "custom/weather" | 28 | "custom/weather" |
29 | "custom/keymap" | 29 | "custom/keymap" |
30 | "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "custom/mako" "clock" ]; | 30 | "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "custom/mako" "custom/lid_inhibitor" "clock" ]; |
31 | 31 | ||
32 | "custom/lid_inhibitor" = { | ||
33 | format = "{}"; | ||
34 | return-type = "json"; | ||
35 | exec = lib.getExe pkgs.waybar-systemd-inhibit; | ||
36 | on-click = lib.getExe' pkgs.waybar-systemd-inhibit "waybar-systemd-inhibit-toggle"; | ||
37 | }; | ||
32 | "custom/mako" = { | 38 | "custom/mako" = { |
33 | format = "{}"; | 39 | format = "{}"; |
34 | return-type = "json"; | 40 | return-type = "json"; |
@@ -61,7 +67,7 @@ in { | |||
61 | text = f"<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>" # noqa: E501 | 67 | text = f"<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>" # noqa: E501 |
62 | if is_silent: | 68 | if is_silent: |
63 | text = f"<span color=\"#ffffff\">{text}</span>" | 69 | text = f"<span color=\"#ffffff\">{text}</span>" |
64 | print(json.dumps({'text': text}, separators=(',', ':')), flush=True) # noqa: E501 | 70 | print(json.dumps({'text': text, 'tooltip': ', '.join(modes)}, separators=(',', ':')), flush=True) # noqa: E501 |
65 | 71 | ||
66 | async def on_properties_changed(interface_name, changed_properties, invalidated_properties): # noqa: E501 | 72 | async def on_properties_changed(interface_name, changed_properties, invalidated_properties): # noqa: E501 |
67 | if "Modes" not in invalidated_properties: | 73 | if "Modes" not in invalidated_properties: |
@@ -122,16 +128,16 @@ in { | |||
122 | }; | 128 | }; |
123 | "custom/worktime" = { | 129 | "custom/worktime" = { |
124 | interval = 60; | 130 | interval = 60; |
125 | exec = lib.getExe pkgs.worktime; | 131 | exec = "${lib.getExe pkgs.worktime} time --waybar"; |
126 | tooltip = false; | 132 | return-type = "json"; |
127 | }; | 133 | }; |
128 | "custom/worktime-today" = { | 134 | "custom/worktime-today" = { |
129 | interval = 60; | 135 | interval = 60; |
130 | exec = "${lib.getExe pkgs.worktime} today"; | 136 | exec = "${lib.getExe pkgs.worktime} today --waybar"; |
131 | tooltip = false; | 137 | return-type = "json"; |
132 | }; | 138 | }; |
133 | "niri/workspaces" = { | 139 | "niri/workspaces" = { |
134 | ignore = ["eff" "pwctl" "kpxc" "bmgr" "edit" "term"]; | 140 | ignore = map ({ name, ... }: name) config.programs.niri.scratchspaces; |
135 | }; | 141 | }; |
136 | "niri/window" = { | 142 | "niri/window" = { |
137 | separate-outputs = true; | 143 | separate-outputs = true; |
@@ -211,13 +217,13 @@ in { | |||
211 | layer = "top"; | 217 | layer = "top"; |
212 | position = "top"; | 218 | position = "top"; |
213 | height = 14; | 219 | height = 14; |
214 | output = [ "!eDP-1" "!DP-2" "!DP-3" ]; | 220 | output = [ "!eDP-1" "!DP-2" "!DP-3" "*" ]; |
215 | modules-left = [ "niri/workspaces" ]; | 221 | modules-left = [ "niri/workspaces" ]; |
216 | modules-center = [ "niri/window" ]; | 222 | modules-center = [ "niri/window" ]; |
217 | modules-right = [ "clock" ]; | 223 | modules-right = [ "clock" ]; |
218 | 224 | ||
219 | "niri/workspaces" = { | 225 | "niri/workspaces" = { |
220 | ignore = ["pwctl" "kpxc" "bmgr" "edit" "term"]; | 226 | ignore = map ({ name, ... }: name) config.programs.niri.scratchspaces; |
221 | }; | 227 | }; |
222 | "niri/window" = { | 228 | "niri/window" = { |
223 | separate-outputs = true; | 229 | separate-outputs = true; |
@@ -254,10 +260,10 @@ in { | |||
254 | } | 260 | } |
255 | 261 | ||
256 | .modules-left { | 262 | .modules-left { |
257 | margin-left: 12px; | 263 | margin-left: 38px; |
258 | } | 264 | } |
259 | .modules-right { | 265 | .modules-right { |
260 | margin-right: 12px; | 266 | margin-right: 38px; |
261 | } | 267 | } |
262 | 268 | ||
263 | .module { | 269 | .module { |
@@ -293,7 +299,7 @@ in { | |||
293 | #tray { | 299 | #tray { |
294 | margin: 0; | 300 | margin: 0; |
295 | } | 301 | } |
296 | #battery, #idle_inhibitor, #backlight, #wireplumber, #custom-mako { | 302 | #battery, #idle_inhibitor, #backlight, #wireplumber, #custom-mako, #custom-lid_inhibitor { |
297 | color: @grey; | 303 | color: @grey; |
298 | margin: 0 5px 0 2px; | 304 | margin: 0 5px 0 2px; |
299 | } | 305 | } |
@@ -302,7 +308,11 @@ in { | |||
302 | margin-left: 6px; | 308 | margin-left: 6px; |
303 | } | 309 | } |
304 | #custom-mako { | 310 | #custom-mako { |
305 | margin-right: 2px; | 311 | margin-right: 4px; |
312 | margin-left: 3px; | ||
313 | } | ||
314 | #custom-lid_inhibitor { | ||
315 | margin-right: 3px; | ||
306 | margin-left: 3px; | 316 | margin-left: 3px; |
307 | } | 317 | } |
308 | #battery { | 318 | #battery { |
@@ -323,8 +333,14 @@ in { | |||
323 | #idle_inhibitor.activated { | 333 | #idle_inhibitor.activated { |
324 | color: @white; | 334 | color: @white; |
325 | } | 335 | } |
336 | #custom-worktime.running, #custom-worktime-today.running { | ||
337 | color: @white; | ||
338 | } | ||
339 | #custom-worktime.over, #custom-worktime-today.over { | ||
340 | color: @orange; | ||
341 | } | ||
326 | 342 | ||
327 | #idle_inhibitor { | 343 | #idle_inhibitor, #custom-lid_inhibitor { |
328 | padding-top: 1px; | 344 | padding-top: 1px; |
329 | } | 345 | } |
330 | 346 | ||
@@ -334,6 +350,7 @@ in { | |||
334 | } | 350 | } |
335 | #clock { | 351 | #clock { |
336 | /* margin-right: 5px; */ | 352 | /* margin-right: 5px; */ |
353 | font-feature-settings: "tnum"; | ||
337 | } | 354 | } |
338 | ''; | 355 | ''; |
339 | }; | 356 | }; |