From 462dd2c4f946fed1aeb5612f1e10e291cf7c9b80 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sat, 17 Apr 2021 17:30:09 +0200 Subject: [PATCH] updated to most recent bt version --- .local/bin/bt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/bt b/.local/bin/bt index 1f30a2b..ce9158c 100755 --- a/.local/bin/bt +++ b/.local/bin/bt @@ -118,8 +118,8 @@ pair(){ scan on #check whether $SCAN_PERIOD seconds has already passed since starting scanning, if not, wait for the rest of that time. start_scan="$(cat /tmp/bt_start_scan$$)" - if [ $((( "$(date +'%s')" - "$start_scan" ))) -lt $SCAN_PERIOD ]; then - sleep_period="$((( "$SCAN_PERIOD" - "$( date +'%s')" + "$start_scan" )))" + if [ $(( $(date +'%s') - $start_scan )) -lt $SCAN_PERIOD ]; then + sleep_period="$(( $SCAN_PERIOD - $( date +'%s') + $start_scan ))" [ "$sleep_period" -gt 1 ] && plural="s" notify-send "Bluetooth" "Searching for devices, please wait $sleep_period second$plural" sleep "$sleep_period"