SXHKD: better volume

This commit is contained in:
Filippo Berto 2023-07-12 18:40:39 +01:00
parent fe488faef3
commit a36b43bf4e
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056

View file

@ -34,8 +34,15 @@
comm -23 <(bspc query -N | sort) <(bspc query -m primary -N | sort) | while read n; do bspc node $n -m primary; done
'';
notifyVolume = pkgs.writeShellScript "notifyVolume" ''
volume=`${pamixer} --get-volume`
${notify} -r 1 -h "int:value:$volume" "Volume $volume%"
PATH=$PATH:"${lib.makeBinPath [ pkgs.coreutils pkgs.pamixer ]}"
sink=`pamixer --get-default-sink | tail -n 1| sed -E 's/.+"(.+)"$/\1/'`
muted=`pamixer --get-mute`
volume=`pamixer --get-volume`
if [[ $muted == "true" ]]; then
${notify} -r 1 -h "int:value:0" "Muted" "$sink"
else
${notify} -r 1 -h "int:value:$volume" "Volume $volume%" "$sink"
fi
'';
notifyBrightness = pkgs.writeShellScript "notifyBrightness" ''
level=`printf "%.0f" $(${xbacklight} -get)`