diff options
Diffstat (limited to 'accounts/gkleen@sif/niri')
-rw-r--r-- | accounts/gkleen@sif/niri/default.nix | 16 | ||||
-rw-r--r-- | accounts/gkleen@sif/niri/swayosd.nix | 53 | ||||
-rw-r--r-- | accounts/gkleen@sif/niri/waybar.nix | 16 |
3 files changed, 70 insertions, 15 deletions
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index 17da42d6..f603a9f9 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix | |||
@@ -2,11 +2,10 @@ | |||
2 | let | 2 | let |
3 | niri = config.programs.niri.package; | 3 | niri = config.programs.niri.package; |
4 | terminal = lib.getExe config.programs.kitty.package; | 4 | terminal = lib.getExe config.programs.kitty.package; |
5 | lightctl = lib.getExe' config.services.avizo.package "lightctl"; | ||
6 | volumectl = lib.getExe' config.services.avizo.package "volumectl"; | ||
7 | makoctl = lib.getExe' config.services.mako.package "makoctl"; | 5 | makoctl = lib.getExe' config.services.mako.package "makoctl"; |
8 | loginctl = lib.getExe' hostConfig.systemd.package "loginctl"; | 6 | loginctl = lib.getExe' hostConfig.systemd.package "loginctl"; |
9 | systemctl = lib.getExe' hostConfig.systemd.package "systemctl"; | 7 | systemctl = lib.getExe' hostConfig.systemd.package "systemctl"; |
8 | swayosd-client = lib.getExe' config.services.swayosd.package "swayosd-client"; | ||
10 | 9 | ||
11 | focus_or_spawn = pkgs.writeShellApplication { | 10 | focus_or_spawn = pkgs.writeShellApplication { |
12 | name = "focus-or-spawn"; | 11 | name = "focus-or-spawn"; |
@@ -122,6 +121,7 @@ in { | |||
122 | imports = [ | 121 | imports = [ |
123 | ./waybar.nix | 122 | ./waybar.nix |
124 | ./mako.nix | 123 | ./mako.nix |
124 | ./swayosd.nix | ||
125 | ]; | 125 | ]; |
126 | 126 | ||
127 | config = { | 127 | config = { |
@@ -577,27 +577,27 @@ in { | |||
577 | }; | 577 | }; |
578 | 578 | ||
579 | "XF86MonBrightnessUp" = { | 579 | "XF86MonBrightnessUp" = { |
580 | action = spawn lightctl "-d" "-e4" "-n1" "up"; | 580 | action = spawn swayosd-client "--brightness" "raise"; |
581 | allow-when-locked = true; | 581 | allow-when-locked = true; |
582 | }; | 582 | }; |
583 | "XF86MonBrightnessDown" = { | 583 | "XF86MonBrightnessDown" = { |
584 | action = spawn lightctl "-d" "-e4" "-n1" "down"; | 584 | action = spawn swayosd-client "--brightness" "lower"; |
585 | allow-when-locked = true; | 585 | allow-when-locked = true; |
586 | }; | 586 | }; |
587 | "XF86AudioRaiseVolume" = { | 587 | "XF86AudioRaiseVolume" = { |
588 | action = spawn volumectl "-d" "-u" "up"; | 588 | action = spawn swayosd-client "--output-volume" "raise"; |
589 | allow-when-locked = true; | 589 | allow-when-locked = true; |
590 | }; | 590 | }; |
591 | "XF86AudioLowerVolume" = { | 591 | "XF86AudioLowerVolume" = { |
592 | action = spawn volumectl "-d" "-u" "down"; | 592 | action = spawn swayosd-client "--output-volume" "lower"; |
593 | allow-when-locked = true; | 593 | allow-when-locked = true; |
594 | }; | 594 | }; |
595 | "XF86AudioMute" = { | 595 | "XF86AudioMute" = { |
596 | action = spawn volumectl "-d" "toggle-mute"; | 596 | action = spawn swayosd-client "--output-volume" "mute-toggle"; |
597 | allow-when-locked = true; | 597 | allow-when-locked = true; |
598 | }; | 598 | }; |
599 | "XF86AudioMicMute" = { | 599 | "XF86AudioMicMute" = { |
600 | action = spawn volumectl "-d" "-m" "toggle-mute"; | 600 | action = spawn swayosd-client "--input-volume" "mute-toggle"; |
601 | allow-when-locked = true; | 601 | allow-when-locked = true; |
602 | }; | 602 | }; |
603 | 603 | ||
diff --git a/accounts/gkleen@sif/niri/swayosd.nix b/accounts/gkleen@sif/niri/swayosd.nix new file mode 100644 index 00000000..48899c10 --- /dev/null +++ b/accounts/gkleen@sif/niri/swayosd.nix | |||
@@ -0,0 +1,53 @@ | |||
1 | { pkgs, ... }: | ||
2 | { | ||
3 | config = { | ||
4 | services.swayosd = { | ||
5 | enable = true; | ||
6 | topMargin = 0.0344; | ||
7 | stylePath = pkgs.runCommand "style.css" { | ||
8 | src = pkgs.writeText "style.scss" '' | ||
9 | window#osd { | ||
10 | padding: 12px 20px; | ||
11 | border-radius: 999px; | ||
12 | border: none; | ||
13 | background: rgba(0, 0, 0, 0.66); | ||
14 | |||
15 | #container { | ||
16 | margin: 16px; | ||
17 | } | ||
18 | |||
19 | image, | ||
20 | label { | ||
21 | color: rgb(255, 255, 255); | ||
22 | } | ||
23 | |||
24 | progressbar:disabled, | ||
25 | image:disabled { | ||
26 | opacity: 0.5; | ||
27 | } | ||
28 | |||
29 | progressbar { | ||
30 | min-height: 6px; | ||
31 | border-radius: 999px; | ||
32 | background: transparent; | ||
33 | border: none; | ||
34 | } | ||
35 | trough { | ||
36 | min-height: inherit; | ||
37 | border-radius: inherit; | ||
38 | border: none; | ||
39 | background: rgba(255, 255, 255, 0.5); | ||
40 | } | ||
41 | progress { | ||
42 | min-height: inherit; | ||
43 | border-radius: inherit; | ||
44 | border: none; | ||
45 | background: rgb(255, 255, 255); | ||
46 | } | ||
47 | } | ||
48 | ''; | ||
49 | buildInputs = with pkgs; [sass]; | ||
50 | } "scss -C --sourcemap=none $src $out"; | ||
51 | }; | ||
52 | }; | ||
53 | } | ||
diff --git a/accounts/gkleen@sif/niri/waybar.nix b/accounts/gkleen@sif/niri/waybar.nix index 625deea5..8667a4a4 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; |
@@ -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 | { |