configuration/local/bin/bluetooth.sh

19 lines
284 B
Bash
Raw Normal View History

2015-10-08 15:31:23 +02:00
#!/bin/bash
# choose MAC address
mac="$(dmenu <<HERE
headset 00:11:67:11:18:9B
zeusplay 60:E3:27:09:12:DE
HERE
)"
2015-10-08 15:51:46 +02:00
command="$(cat <<HERE
connect ${mac#* }
quit
HERE
)"
2015-10-08 15:31:23 +02:00
if ! pgrep pulseaudio; then pulseaudio --start 2> /dev/null ; fi
2015-10-08 15:51:46 +02:00
echo "$command" | bluetoothctl > /dev/null 2>&1
2015-10-08 15:31:23 +02:00