diff --git a/.config/nvim/pack/plugins/opt/lspconfig b/.config/nvim/pack/plugins/opt/lspconfig index cf95480..eeda94a 160000 --- a/.config/nvim/pack/plugins/opt/lspconfig +++ b/.config/nvim/pack/plugins/opt/lspconfig @@ -1 +1 @@ -Subproject commit cf95480e876ef7699bf08a1d02aa0ae3f4d5f353 +Subproject commit eeda94a0b5b370d837f1ba6f70c8038b3936808b diff --git a/.config/suckless b/.config/suckless index 1f6992d..aa631e1 160000 --- a/.config/suckless +++ b/.config/suckless @@ -1 +1 @@ -Subproject commit 1f6992d7d78f931120a1bb642b495ad1b9e462bf +Subproject commit aa631e13d23ea0b0cfa72ea13411f6dbad18ecbf diff --git a/bin/set-vol b/bin/set-vol index 9b419a3..85a9e61 100755 --- a/bin/set-vol +++ b/bin/set-vol @@ -1,12 +1,20 @@ #!/bin/bash -e SINK='@DEFAULT_AUDIO_SINK@' +WPCUR="$(wpctl get-volume "$SINK")" +CUR="$((10#$(tr -dc '0-9' <<< "$WPCUR")))" + +grep -q MUTED <<< "$WPCUR" && MUTE=1 || MUTE=0 if [ "$1" == 'm' ]; then - wpctl set-mute "$SINK" toggle + if [ "$MUTE" = 1 ]; then + wpctl set-mute "$SINK" 0 + dunstify -a 'changeVolume' -u low -i audio-volume-high -h string:x-dunst-stack-tag:vol -h int:value:"$CUR" "$CUR%" + else + wpctl set-mute "$SINK" 1 + dunstify -a "changeVolume" -u low -i audio-volume-muted -h string:x-dunst-stack-tag:vol "Mute" + fi else - CUR="$((10#$(wpctl get-volume "$SINK" | tr -dc '0-9')))" - case "${1:0:1}" in '') echo "$CUR"; exit ;; '+'|'-') CUR="$((CUR - CUR % $1 + $1))" ;; @@ -14,7 +22,10 @@ else esac wpctl set-volume -l 1.5 "$SINK" "$CUR%" - wpctl set-mute "$SINK" 0 + if [ "$MUTE" = 1 ]; then + wpctl set-mute "$SINK" 0 + fi + dunstify -a 'changeVolume' -u low -i audio-volume-high -h string:x-dunst-stack-tag:vol -h int:value:"$CUR" "$CUR%" fi # update sbar