(scripts) adjusted audio switches script to work with both rofi and

fuzzel
This commit is contained in:
quak
2025-08-03 21:55:27 +02:00
parent 31f30d002b
commit 8644417a2c
2 changed files with 8 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
bindsym $mod+a exec --no-startup-id bash select-audio-sink.sh bindsym $mod+a exec --no-startup-id bash audio-sink-switcher.sh
######################### #########################

View File

@@ -31,7 +31,13 @@ select_audio_sink() {
lines=${#ids[@]} lines=${#ids[@]}
fi fi
selection="$(printf "%s\n" "${names[@]//\"/}" | fuzzel --lines ${lines} --dmenu --select-index ${number})" if $(which rofi &>/dev/null); then
selection="$(printf "%s\n" "${names[@]//\"/}" | rofi -dmenu -fixed-num-lines ${lines} -selected-row ${number} -case-smart)"
elif $(which fuzzel &>/dev/null); then
selection="$(printf "%s\n" "${names[@]//\"/}" | fuzzel --lines ${lines} --dmenu --select-index ${number})"
else
return 1
fi
if [[ -z "${selection}" ]]; then if [[ -z "${selection}" ]]; then
return 1 return 1