aboutsummaryrefslogtreecommitdiff
path: root/dmenu-connect
diff options
context:
space:
mode:
Diffstat (limited to 'dmenu-connect')
-rwxr-xr-xdmenu-connect61
1 files changed, 61 insertions, 0 deletions
diff --git a/dmenu-connect b/dmenu-connect
new file mode 100755
index 0000000..64194f9
--- /dev/null
+++ b/dmenu-connect
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+
+# generic connection manager
+
+# Bluetooth headset on Thinkpad X220
+# bt controller 60:D8:19:AE:22:77 is the default
+# bt controller 48:51:B7:EB:7B:B5 is removed in udev
+
+headset="E8:07:BF:3C:5F:65"
+microphone="alsa_input.usb-MUSIC-BOOST_USB_Microphone_MB-306-00.mono-fallback"
+
+choices="Connect BT Headset\nDisconnect BT Headset\nConnect USB Micro\nConnect rnnoise filter\nExit menu"
+
+selected=$(echo -e $choices | dmenu -c -i -z 500 -l 5 -p "Connector")
+
+#echo $selected
+
+case $selected in
+
+ "Connect BT Headset")
+ bluetoothctl connect $headset &> /dev/null
+ sleep 1
+ defsink=$(pactl get-default-sink)
+ dunstify -t 5000 -a "BT Headset" -u low -i media-removable-symbolic \
+ -h string:x-dunst-stack-tag:bt-headset "Default sink = $defsink"
+ ;;
+
+ "Disconnect BT Headset")
+ bluetoothctl disconnect $headset &> /dev/null
+ sleep 1
+ defsink=$(pactl get-default-sink)
+ dunstify -t 5000 -a "BT Headset" -u low -i media-removable-symbolic \
+ -h string:x-dunst-stack-tag:bt-headset "Default sink = $defsink"
+ ;;
+
+ "Connect USB Micro")
+ pactl set-default-source $microphone &> /dev/null
+ sleep 1
+ defsource=$(pactl get-default-source)
+ dunstify -t 5000 -a "Microphone" -u low -i media-removable-symbolic \
+ -h string:x-dunst-stack-tag:usb-microphone "Default source = $defsource"
+ ;;
+
+ "Connect rnnoise filter")
+ pactl set-default-source "rnnoise_source" &> /dev/null
+ sleep 1
+ defsource=$(pactl get-default-source)
+ dunstify -t 5000 -a "Microphone" -u low -i media-removable-symbolic \
+ -h string:x-dunst-stack-tag:usb-microphone "Default source = $defsource"
+ ;;
+
+ "Exit menu")
+ exit 0
+ ;;
+
+ *)
+ ;;
+esac
+
+
+