sxmo_hook_inputhandler: set volume directly

now that i'm using SXMO_NO_AUDIO, i can't use sxmo_audio.sh
This commit is contained in:
Colin 2023-11-20 06:57:51 +00:00
parent 89b0b8884b
commit c7b065eed9
2 changed files with 8 additions and 8 deletions

View File

@ -70,7 +70,7 @@ let
hookPkgs = {
inputhandler = pkgs.static-nix-shell.mkBash {
pname = "sxmo_hook_inputhandler.sh";
pkgs = [ "coreutils" ];
pkgs = [ "coreutils" "pulseaudio" ];
src = ./hooks;
};
postwake = pkgs.static-nix-shell.mkBash {

View File

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils
#!nix-shell -i bash -p coreutils -p pulseaudio
# input map considerations
# - using compound actions causes delays.
@ -122,23 +122,23 @@ case "$ACTION" in
# powerbutton_three: intentional no-op because overloading the kill-window handler is risky
"volup_one")
handle_with sxmo_audio.sh vol up "$VOL_INCR_1"
handle_with pactl set-sink-volume @DEFAULT_SINK@ +"$VOL_INCR_1%"
;;
"volup_two")
handle_with sxmo_audio.sh vol up "$VOL_INCR_2"
handle_with pactl set-sink-volume @DEFAULT_SINK@ +"$VOL_INCR_2%"
;;
"volup_three")
handle_with sxmo_audio.sh vol up "$VOL_INCR_3"
handle_with pactl set-sink-volume @DEFAULT_SINK@ +"$VOL_INCR_3%"
;;
"voldown_one")
handle_with sxmo_audio.sh vol down "$VOL_INCR_1"
handle_with pactl set-sink-volume @DEFAULT_SINK@ -"$VOL_INCR_1%"
;;
"voldown_two")
handle_with sxmo_audio.sh vol down "$VOL_INCR_2"
handle_with pactl set-sink-volume @DEFAULT_SINK@ -"$VOL_INCR_2%"
;;
"voldown_three")
handle_with sxmo_audio.sh vol down "$VOL_INCR_3"
handle_with pactl set-sink-volume @DEFAULT_SINK@ -"$VOL_INCR_3%"
;;
esac