mirror of https://git.sr.ht/~skiqqy/bin
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
657 B
37 lines
657 B
#!/usr/bin/env bash
|
|
# Simple bluetoothctl wrapper script
|
|
# Author: Skiqqy
|
|
|
|
e='60:C5:E6:12:87:97' # My ear phones
|
|
h='5C:C6:E9:16:26:11' # My head phones
|
|
|
|
case "$2" in
|
|
headpones|h|H)
|
|
dev="$h"
|
|
;;
|
|
e|earphones|E)
|
|
dev="$e"
|
|
;;
|
|
*)
|
|
printf 'Usage: %s (c|d|pair) E|H\n' "$(basename "$0")"
|
|
exit
|
|
esac
|
|
|
|
case "$1" in
|
|
pair)
|
|
bluetoothctl pair "$dev"
|
|
exit
|
|
;;
|
|
c|connect|C)
|
|
com=connect
|
|
;;
|
|
d|disconnect|D)
|
|
com=disconnect
|
|
;;
|
|
*)
|
|
printf 'Usage: %s (c|d|pair) E|H\n' "$(basename "$0")"
|
|
exit
|
|
;;
|
|
esac
|
|
|
|
bluetoothctl "$com" "$dev" |