Use wob to display a volume/brightness overlay

This commit is contained in:
Sijmen 2023-07-03 11:51:35 +02:00
parent 1c84f86a3d
commit 487b2baa85
Signed by: vijfhoek
GPG key ID: DAF7821E067D9C48

View file

@ -51,13 +51,17 @@
"Dell Inc. DELL S2722DGM 3P84Z83" = { pos = "0 0"; mode = "2560x1440@144Hz"; }; # thuis links (hdmi) "Dell Inc. DELL S2722DGM 3P84Z83" = { pos = "0 0"; mode = "2560x1440@144Hz"; }; # thuis links (hdmi)
}; };
keybindings = lib.mkOptionDefault { keybindings = lib.mkOptionDefault {
XF86MonBrightnessDown = "exec ${pkgs.light}/bin/light -U 5"; XF86MonBrightnessDown = "exec ${pkgs.light}/bin/light -U 5 && ${pkgs.light}/bin/light -G | cut -d. -f1 > $SWAYSOCK.wob";
XF86MonBrightnessUp = "exec ${pkgs.light}/bin/light -A 5"; XF86MonBrightnessUp = "exec ${pkgs.light}/bin/light -A 5 && ${pkgs.light}/bin/light -G | cut -d. -f1 > $SWAYSOCK.wob";
"shift+XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 1"; "shift+XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 1 && ${pkgs.light}/bin/light -G | cut -d. -f1 > $SWAYSOCK.wob";
"shift+XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 1"; "shift+XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 1 && ${pkgs.light}/bin/light -G | cut -d. -f1 > $SWAYSOCK.wob";
XF86AudioRaiseVolume = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%'";
XF86AudioLowerVolume = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%'"; XF86AudioRaiseVolume = "exec ${pkgs.pamixer}/bin/pamixer -ui 5 && ${pkgs.pamixer}/bin/pamixer --get-volume > $SWAYSOCK.wob";
XF86AudioMute = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle'"; XF86AudioLowerVolume = "exec ${pkgs.pamixer}/bin/pamixer -ud 5 && ${pkgs.pamixer}/bin/pamixer --get-volume > $SWAYSOCK.wob";
"shift+XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -ui 1 && ${pkgs.pamixer}/bin/pamixer --get-volume > $SWAYSOCK.wob";
"shift+XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -ud 1 && ${pkgs.pamixer}/bin/pamixer --get-volume > $SWAYSOCK.wob";
XF86AudioMute = "exec ${pkgs.pamixer}/bin/pamixer -t && ([[ $(${pkgs.pamixer}/bin/pamixer --get-mute) = true ]] && echo 0 > $SWAYSOCK.wob) || ${pkgs.pamixer}/bin/pamixer --get-volume > $SWAYSOCK.wob";
Print = "exec '${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | wl-copy -t image/png'"; Print = "exec '${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | wl-copy -t image/png'";
"shift+Print" = "exec '${pkgs.grim}/bin/grim - | wl-copy -t image/png'"; "shift+Print" = "exec '${pkgs.grim}/bin/grim - | wl-copy -t image/png'";
@ -82,6 +86,7 @@
}; };
startup = [ startup = [
{ command = "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"; } { command = "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"; }
{ command = "mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | ${pkgs.wob}/bin/wob"; }
]; ];
}; };
}; };