2022-05-22 19:37:41 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-07-17 11:03:13 +02:00
|
|
|
source $HOME/.config/dmenu/config
|
|
|
|
|
2022-05-22 19:37:41 +02:00
|
|
|
notAvailable=$(pactl list sinks | grep 'analog-output-headphones' | grep 'not available')
|
|
|
|
|
|
|
|
[ ! -z "$notAvailable" ] && quick-notify "Port Master" "Only one port available" && exit
|
|
|
|
|
|
|
|
current=$(pactl list sinks | grep 'Active Port' | awk '{ print $3 }')
|
|
|
|
[ "$current" = "analog-output-speaker" ] && current="Speakers" || current="Headphones"
|
|
|
|
|
2022-07-17 11:03:13 +02:00
|
|
|
case "$(printf "Speakers\\nHeadphones" | $DMENU -p "Current: $current ")" in
|
2022-05-22 19:37:41 +02:00
|
|
|
"Speakers") pactl set-sink-port 0 analog-output-speaker ;;
|
|
|
|
"Headphones") pactl set-sink-port 0 analog-output-headphones ;;
|
|
|
|
esac
|