From 0809cef531d2753d79373d51c04341ca34f85f67 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 31 Aug 2021 12:47:41 -0400 Subject: [PATCH] Add btre function --- .config/fish/functions/btre.fish | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .config/fish/functions/btre.fish diff --git a/.config/fish/functions/btre.fish b/.config/fish/functions/btre.fish new file mode 100644 index 0000000..13641aa --- /dev/null +++ b/.config/fish/functions/btre.fish @@ -0,0 +1,20 @@ +function btre -a device -d 'Reconnect to a known bluetooth device' + set -l devices 00:1B:66:E3:07:3A CC:98:8B:3E:6B:9D + + bluetoothctl power on + + for device in $devices + bluetoothctl remove $device + end + + nohup bluetoothctl scan on >/dev/null & + + for device in $devices + bluetoothctl pair $device + sleep 1 + bluetoothctl trust $device + bluetoothctl connect $device + end + + pkill bluetoothctl +end