diff options
Diffstat (limited to 'services/sxhkd.nix')
-rw-r--r-- | services/sxhkd.nix | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/services/sxhkd.nix b/services/sxhkd.nix index 19d6917..3bb3da8 100644 --- a/services/sxhkd.nix +++ b/services/sxhkd.nix | |||
@@ -4,17 +4,34 @@ | |||
4 | , ... | 4 | , ... |
5 | }: | 5 | }: |
6 | 6 | ||
7 | let | ||
8 | progress = text: value: | ||
9 | '' | ||
10 | ${pkgs.libnotify}/bin/notify-send ${text} -h int:value:${value} -h string:synchronous:volume -h string:hlcolor:"${theme.base0C}" | ||
11 | ''; | ||
12 | brightness = pkgs.writeScriptBin "brightness" '' | ||
13 | ${pkgs.light}/bin/light $@ | ||
14 | v=$(${pkgs.light}/bin/light -G) | ||
15 | ${progress "brightness" "$v"} | ||
16 | ''; | ||
17 | volume = pkgs.writeScriptBin "volume" '' | ||
18 | ${pkgs.alsaUtils}/bin/amixer $@ | ||
19 | v=$(${pkgs.alsaUtils}/bin/amixer sget Master | ${pkgs.gawk}/bin/awk -F"[][%]" '/Left:/ {print $2}') | ||
20 | ${progress "volume" "$v"} | ||
21 | ''; | ||
22 | |||
23 | in | ||
7 | { | 24 | { |
8 | services.sxhkd = { | 25 | services.sxhkd = { |
9 | enable = true; | 26 | enable = true; |
10 | keybindings = { | 27 | keybindings = { |
11 | "super + slash" = "${pkgs.light}/bin/light -A 5"; | 28 | "super + slash" = "${brightness}/bin/brightness -A 2"; |
12 | "super + shift + slash" = "${pkgs.light}/bin/light -U 5"; | 29 | "super + shift + slash" = "${brightness}/bin/brightness -U 2"; |
13 | "super + semicolon" = "${pkgs.alsaUtils}/bin/amixer sset Master 2%+"; | 30 | "super + semicolon" = "${volume}/bin/volume sset Master 2%+"; |
14 | "super + shift + semicolon" = "${pkgs.alsaUtils}/bin/amixer sset Master 2%-"; | 31 | "super + shift + semicolon" = "${volume}/bin/volume sset Master 2%-"; |
15 | "super + space" = "${pkgs.dunst}/bin/dunstctl close"; | 32 | "super + ctrl + space" = "${pkgs.dunst}/bin/dunstctl close"; |
16 | "super + ctrl + space" = "${pkgs.dunst}/bin/dunstctl close-all"; | ||
17 | "super + shift + space" = "${pkgs.dunst}/bin/dunstctl history-pop"; | 33 | "super + shift + space" = "${pkgs.dunst}/bin/dunstctl history-pop"; |
34 | "super + ctrl + shift + space" = "${pkgs.dunst}/bin/dunstctl close-all"; | ||
18 | }; | 35 | }; |
19 | }; | 36 | }; |
20 | } | 37 | } |