From a57f02f6a6aeaad6aa8dfb61e6fd5a1d7aa02b72 Mon Sep 17 00:00:00 2001 From: Ich bin Frei Date: Sun, 13 Dec 2020 06:20:07 +0200 Subject: [PATCH] Refresh clock at exactly 00 seconds. Update interval in dwmblocks/config.h has to be 0 --- .local/bin/statusbar/clock | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index d25e8d00..6582334a 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -1,5 +1,13 @@ #!/bin/sh +# Refresh clock at exactly 00 seconds +refresh(){ + SCRIPT_NAME=`basename "$0"` + pidof -x $SCRIPT_NAME && exit 1 # exit if already running + sleep $((60-$(date "+%S"))) + kill -35 $(pidof dwmblocks) +} + clock=$(date '+%I') case "$clock" in @@ -27,3 +35,4 @@ case $BLOCK_BUTTON in esac date "+%Y %b %d (%a) $icon%I:%M%p" +refresh &