Unmute when turning volume up/down

Closes #5942
Co-authored-by: @Pegrorim
This commit is contained in:
David Heinemeier Hansson
2026-05-22 15:18:14 +02:00
parent ccfee4e94d
commit bb6632ad82
+6
View File
@@ -23,6 +23,10 @@ volume_muted() {
volume_state | grep -q MUTED
}
unmute_output() {
wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 >/dev/null
}
case "$action" in
raise) action="+5" ;;
lower) action="-5" ;;
@@ -42,9 +46,11 @@ if [[ $action == "mute-toggle" ]]; then
wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle >/dev/null
elif [[ $action == +* ]]; then
step="${action#+}"
unmute_output
wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ "${step}%+"
elif [[ $action == -* ]]; then
step="${action#-}"
unmute_output
wpctl set-volume @DEFAULT_AUDIO_SINK@ "${step}%-"
else
echo "Unknown volume action: $action"