Refresh clock at exactly 00 seconds. Update interval in dwmblocks/config.h has to be 0

This commit is contained in:
Ich bin Frei 2020-12-13 06:20:07 +02:00
parent c3eefd7a68
commit a57f02f6a6

View File

@ -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 &