diff options
author | Philip Wittamore <philip@wittamore.com> | 2025-05-31 23:34:07 +0200 |
---|---|---|
committer | Philip Wittamore <philip@wittamore.com> | 2025-05-31 23:34:07 +0200 |
commit | 1b276b9a2600c902aa865c5b52dc1b791437a516 (patch) | |
tree | dab45a58b253cf3dfe41375cc83989798c6fe541 /dmenu-audio | |
parent | 97a70c5573f70a2b638bd50c1f6c0c8b88296fa1 (diff) | |
download | scripts-1b276b9a2600c902aa865c5b52dc1b791437a516.tar.gz scripts-1b276b9a2600c902aa865c5b52dc1b791437a516.tar.bz2 scripts-1b276b9a2600c902aa865c5b52dc1b791437a516.zip |
update
Diffstat (limited to 'dmenu-audio')
-rwxr-xr-x | dmenu-audio | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dmenu-audio b/dmenu-audio new file mode 100755 index 0000000..ccad8c1 --- /dev/null +++ b/dmenu-audio @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +choices="Connect BT headset\nSelect Output\nSelect Input\nExit" + +result=$(echo -e $choices | dmenu -bw 4 -c -i -l 5 -p "Audio") + +case $result in + + "Connect BT headset") + headset="E8:07:BF:3C:5F:65" + bluetoothctl connect $headset &> /dev/null + ;; + + "Select Input") + + choices=$(pactl list short sources | cut -f2) + choices="$choices Exit" + result=$(echo $choices | sed 's/ /\'$'\n''/g' | dmenu -bw 4 -c -i -l 5 -p "Audio Input") || exit 0 + if [ $result = "Exit" ]; then + exit 0 + fi + pactl set-default-source $result + notify-send -t 2000 -u normal "Audio input set to $result" + + ;; + + "Select Output") + + choices=$(pactl list short sinks | cut -f2) + choices="$choices Exit" + result=$(echo $choices | sed 's/ /\'$'\n''/g' | dmenu -bw 4 -c -i -l 5 -p "Audio Output") || exit 0 + if [ $result = "Exit" ]; then + exit 0 + fi + pactl set-default-sink $result + notify-send -t 2000 -u normal "Audio output set to $result" + echo $result + ;; + + *) + exit 0 + ;; +esac |