From 1530d7601932a0615bc205d2ce688b03e7fb29eb Mon Sep 17 00:00:00 2001 From: Ich bin Frei Date: Sun, 13 Dec 2020 06:57:14 +0200 Subject: [PATCH] Fixed check for already running --- .local/bin/statusbar/clock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 6582334a..c9edac41 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -2,8 +2,8 @@ # Refresh clock at exactly 00 seconds refresh(){ - SCRIPT_NAME=`basename "$0"` - pidof -x $SCRIPT_NAME && exit 1 # exit if already running + PID=$(pidof -x `basename "$0"`) + [ "$PID" = "$BASHPID" ] || exit 1 # exit if already running sleep $((60-$(date "+%S"))) kill -35 $(pidof dwmblocks) }