Pipewire script

This commit is contained in:
Out Of Ideas 2024-03-20 21:44:45 -05:00
parent 26c12af868
commit bc93160b71
1 changed files with 15 additions and 0 deletions

15
fuzzel/scripts/pipewire.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
LAUNCHER_CMD="fuzzel --dmenu"
DEVICES=$(pactl list sinks short | awk '{print $2}')
SELECTED_OPTION=$(echo "$DEVICES" | ${LAUNCHER_CMD})
i=1
while [ "$i" -le $(echo "$DEVICES" | wc -l) ]; do
device=$(echo "$DEVICES" | head -n${i} | tail +${i})
echo $(test "$device" = "$SELECTED_OPTION")
if $(test "$device" = "$SELECTED_OPTION"); then
pactl set-default-sink "$device"
fi
i=$(expr $i + 1 )
done