blob: 71f6089886c90f8a013cd152c72fdf8c9dd02b1b [file] [log] [blame]
Copybara botca5ce642024-11-08 17:38:08 +01001#!/bin/bash
2export KEYBOARD_MAC={{ .switchKeyboard.mac | quote }}
3export CONNECTED=$(bluetoothctl devices Connected | grep "$KEYBOARD_MAC")
4if [[ "$CONNECTED" == '' ]]; then
5 bluetoothctl unblock "$KEYBOARD_MAC"
6 bluetoothctl connect "$KEYBOARD_MAC"
7else
8 bluetoothctl disconnect "$KEYBOARD_MAC"
9 bluetoothctl block "$KEYBOARD_MAC"
10fi