config/.local/bin/set-default-sink

15 lines
384 B
Bash
Executable File

#!/bin/bash
choice=$(pactl list short sinks | awk '{print $2}' | dmenu -i -p "which sink should be default?")
if [ -z "$choice" ] ; then
exit 0;
fi
default_loc="$HOME/.cache/pactl-default-sink"
rm "$default_loc" --force # to ignore if it isn't there
touch "$default_loc"
echo "$choice" > "$default_loc"
pactl set-default-sink "$choice" # make sure that the chosen sink is the