mirror of https://git.sr.ht/~skiqqy/bin
parent
3cec787b46
commit
396a066c19
@ -0,0 +1,37 @@ |
||||
#!/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" |
Loading…
Reference in new issue