configuration/local/bin/bluetooth.sh
2015-10-08 15:31:23 +02:00

16 lines
279 B
Bash
Executable File

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