This repository has been archived on 2026-08-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
dots/.bin/toggle-bt-device
T

12 lines
221 B
Bash
Executable File

#!/usr/bin/env bash
status="$(bluetoothctl info "$1" | grep Connected | cut -f 2 -d ':' | cut -f 2 -d ' ')"
if [ "$status" == "yes" ]
then
bluetoothctl disconnect "$1"
else
trust "$1"
bluetoothctl connect "$1"
fi