selecting connected device disconnects it
This commit is contained in:
parent
3a0fabef13
commit
cbd1b2f83d
@ -62,3 +62,4 @@ This should only be an issue if `bluetoothctl scan off` is unreliable for you th
|
||||
- find a way to get something similar to `grep -vf` without the need of temp files.
|
||||
- only list connected devices to disconnect from, not all paired devices -> **Implemented**
|
||||
- only list not trusted devices in trust menu -> **Implemented**
|
||||
- selecting already connected device disconnects it -> **Implemented**
|
||||
|
9
bt
9
bt
@ -221,8 +221,13 @@ case $choice in
|
||||
[ "$dev_no" != "" ] && dev_id=$( echo "$bt_IDS" | nl | grep -P "^.*$dev_no\t" | awk '{print $2}')
|
||||
if [ -n "$dev_id" ]; then
|
||||
power on
|
||||
bluetoothctl devices | grep -q "$dev_id" || bluetoothctl pair "$dev_id"
|
||||
bluetoothctl connect "$dev_id"
|
||||
if bluetoothctl info "$dev_id" | grep -q "Connected: yes"
|
||||
then
|
||||
bluetoothctl disconnect "$dev_id"
|
||||
else
|
||||
bluetoothctl devices | grep -q "$dev_id" || bluetoothctl pair "$dev_id"
|
||||
bluetoothctl connect "$dev_id"
|
||||
fi
|
||||
fi;;
|
||||
esac
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user