From 12b1ad09f856a466e3faf6e958c158f12794977a Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Wed, 14 Jun 2023 20:26:33 +0200 Subject: [PATCH] Trust bluetooth devices before connecting --- .bin/toggle-bt-device | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.bin/toggle-bt-device b/.bin/toggle-bt-device index 2792b9f..e6c901e 100755 --- a/.bin/toggle-bt-device +++ b/.bin/toggle-bt-device @@ -2,10 +2,10 @@ status="$(bluetoothctl info "$1" | grep Connected | cut -f 2 -d ':' | cut -f 2 -d ' ')" -if [ "$status" == "no" ] -then - bluetoothctl connect "$1" -elif [ "$status" == "yes" ] +if [ "$status" == "yes" ] then bluetoothctl disconnect "$1" +else + trust "$1" + bluetoothctl connect "$1" fi