From 98abd409f99e5c3b1d4d2a90f741c680cb4e3929 Mon Sep 17 00:00:00 2001 From: Ich bin Frei Date: Sun, 13 Dec 2020 03:51:44 +0200 Subject: [PATCH] Refresh clock at exactly 00 seconds. Update interval in dwmblocks/config.h has to be 0 --- .local/bin/statusbar/clock | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index d25e8d00..4da872ad 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -1,5 +1,11 @@ #!/bin/sh +# Refresh clock at exactly 00 seconds +refresh(){ + sleep $((60-$(date "+%S"))) + kill -35 $(pidof dwmblocks) +} + clock=$(date '+%I') case "$clock" in @@ -27,3 +33,4 @@ case $BLOCK_BUTTON in esac date "+%Y %b %d (%a) $icon%I:%M%p" +refresh &