diff options
author | Philip Wittamore <philip@wittamore.com> | 2025-06-09 10:07:40 +0200 |
---|---|---|
committer | Philip Wittamore <philip@wittamore.com> | 2025-06-09 10:07:40 +0200 |
commit | c47c8720b345ecbfd35db66c84437a51a0902245 (patch) | |
tree | 6c1d9556dbb4ddf3ccdf1c3697982d4fc6b72e98 | |
parent | 3dc16b7526b3accbda455531d6f62577592ec5de (diff) | |
download | scripts-c47c8720b345ecbfd35db66c84437a51a0902245.tar.gz scripts-c47c8720b345ecbfd35db66c84437a51a0902245.tar.bz2 scripts-c47c8720b345ecbfd35db66c84437a51a0902245.zip |
update
-rwxr-xr-x | dmenu-audio | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/dmenu-audio b/dmenu-audio index ccad8c1..7600422 100755 --- a/dmenu-audio +++ b/dmenu-audio @@ -1,17 +1,22 @@ #!/usr/bin/env bash -choices="Connect BT headset\nSelect Output\nSelect Input\nExit" +choices=" Connect BT headset\n Disconnect BT headset\n Select Output\n Select Input\n Play Music\n Pause/Play Music\nExit" -result=$(echo -e $choices | dmenu -bw 4 -c -i -l 5 -p "Audio") +result=$(echo -e $choices | dmenu -bw 4 -c -i -l 7 -p "Audio") case $result in - "Connect BT headset") + " Connect BT headset") headset="E8:07:BF:3C:5F:65" bluetoothctl connect $headset &> /dev/null ;; - "Select Input") + " Disconnect BT headset") + headset="E8:07:BF:3C:5F:65" + bluetoothctl disconnect $headset &> /dev/null + ;; + + " Select Input") choices=$(pactl list short sources | cut -f2) choices="$choices Exit" @@ -24,7 +29,7 @@ case $result in ;; - "Select Output") + " Select Output") choices=$(pactl list short sinks | cut -f2) choices="$choices Exit" @@ -34,9 +39,19 @@ case $result in fi pactl set-default-sink $result notify-send -t 2000 -u normal "Audio output set to $result" - echo $result + exit 0 + ;; + + " Play Music") + dmenu-playmusic + exit 0 ;; + " Pause/Play Music") + playerctl play-pause + exit 0 + ;; + *) exit 0 ;; |