2021-08-31 16:47:41 +00:00
|
|
|
function btre -a device -d 'Reconnect to a known bluetooth device'
|
2021-09-29 15:50:51 +00:00
|
|
|
set -l devices CC:98:8B:3E:6B:9D 00:1B:66:E3:07:3A
|
|
|
|
set -l index 1
|
|
|
|
|
|
|
|
if test -n "$device"
|
|
|
|
set index $device
|
|
|
|
end
|
2021-08-31 16:47:41 +00:00
|
|
|
|
|
|
|
bluetoothctl power on
|
|
|
|
|
2021-09-29 15:50:51 +00:00
|
|
|
bluetoothctl remove $devices[$index]
|
2021-08-31 16:47:41 +00:00
|
|
|
|
|
|
|
nohup bluetoothctl scan on >/dev/null &
|
2021-09-29 15:50:51 +00:00
|
|
|
sleep 2
|
2021-08-31 16:47:41 +00:00
|
|
|
|
2021-09-29 15:50:51 +00:00
|
|
|
bluetoothctl pair $devices[$index]
|
|
|
|
bluetoothctl trust $devices[$index]
|
|
|
|
bluetoothctl connect $devices[$index]
|
2021-10-28 16:21:25 +00:00
|
|
|
sleep 2
|
2021-08-31 16:47:41 +00:00
|
|
|
|
|
|
|
pkill bluetoothctl
|
|
|
|
end
|