only scan for devices on re-pairing if necessary
This commit is contained in:
parent
4ed78ac6a0
commit
1223574c2b
12
bt
12
bt
@ -259,10 +259,14 @@ case $choice in
|
|||||||
else
|
else
|
||||||
if ! bluetoothctl paired-devices | grep -q "$dev_id"; then
|
if ! bluetoothctl paired-devices | grep -q "$dev_id"; then
|
||||||
echo "not in paired-devices list, re-adding (device needs to be in pairing mode for this)"
|
echo "not in paired-devices list, re-adding (device needs to be in pairing mode for this)"
|
||||||
notify-send "bt" "device not in paired-devices list, re-adding (device needs to be in pairing mode for this)"
|
notify-send "bt" "device not in paired-devices list, re-pairing"
|
||||||
scan on
|
all_devices="$(bluetoothctl devices | cut -d' ' -f2)"
|
||||||
echo "Scan on"
|
if ! echo "$dev_id" | grep -q "$all_devices"; then
|
||||||
sleep "$SCAN_PERIOD"
|
scan on
|
||||||
|
echo "Scan on"
|
||||||
|
notify-send "bt" "Scanning for new devices..."
|
||||||
|
sleep "$SCAN_PERIOD"
|
||||||
|
fi
|
||||||
echo Attempting to pair...
|
echo Attempting to pair...
|
||||||
bluetoothctl pair "$dev_id"
|
bluetoothctl pair "$dev_id"
|
||||||
scan off
|
scan off
|
||||||
|
Loading…
Reference in New Issue
Block a user