diff --git a/hm_modules/sxhkd.nix b/hm_modules/sxhkd.nix index 73e8b58..9155175 100644 --- a/hm_modules/sxhkd.nix +++ b/hm_modules/sxhkd.nix @@ -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)`