From 8fab0c396016b85c44c2642d0cae62f56f91d62b Mon Sep 17 00:00:00 2001 From: ray Date: Sat, 31 Oct 2020 21:59:41 +0000 Subject: [PATCH] improve border flash script --- border_flash.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/border_flash.sh b/border_flash.sh index 90f7943..ff6e83e 100755 --- a/border_flash.sh +++ b/border_flash.sh @@ -1,7 +1,15 @@ #!/bin/sh +_lockfile="$HOME/.cache/border_flash_lock" +if [ -f $_lockfile ] ; then + rm "$_lockfile" +fi bspc subscribe node_focus | while read -a msg ; do - bspc config focused_border_color '#ff2222' \ - && sleep 0.2 \ - && bspc config focused_border_color '#222222' + if ! [ -f $_lockfile ] ; then + touch "$_lockfile" \ + && bspc config focused_border_color '#ff2222' \ + && sleep 1 \ + && bspc config focused_border_color '#222222' \ + && rm "$_lockfile" & + fi done