From c00b14c75468f7c91cb0e89de20d8433fba7c917 Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Fri, 6 Jun 2025 23:42:59 +0200 Subject: update --- pw-date | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'pw-date') diff --git a/pw-date b/pw-date index 17105e5..05b2998 100755 --- a/pw-date +++ b/pw-date @@ -1,26 +1,17 @@ #!/usr/bin/env bash # unfortunately cal is a bit limited here, -# so I use orage, an xfce4 calendar app +# so I also use orage, an xfce4 calendar app +# This is updated by signal 1, so 1 + 34 = +# kill -35 $(pidof dwmblocks) or +# pkill -RTMIN+1 dwmblocks -# X220 screen is 1366x768 -width=300 -height=180 -X=$((1366-width)) -Y=24 # bar height + +echo -e "┊ $(date '+%a %d %b %T')" case $BLOCK_BUTTON in - 1) - pid=$(wmctrl -lp | awk '/Orage/{print $3}') - if (( pid > 0 )) ; then - kill -9 "$pid" - else - { orage > /dev/null 2>&1; } & - wmctrl -r "orage" -e "0,$X,$Y,$width,$height" - fi - ;; - - 3) + + 1) TODAY=$(date '+%-d') HEAD=$(cal | head -n1) BODY=$(cal | tail -n7 | sed -z "s|$TODAY|$TODAY|1") @@ -30,8 +21,24 @@ case $BLOCK_BUTTON in -h string:x-canonical-private-synchronous:calendar \ -u normal ;; + + 3) + # X220 screen is 1366x768 + width=300 + height=180 + X=$((1366-width)) + Y=24 # bar height - + # toggle Orage on/off + pid=$(wmctrl -lp | awk '/Orage/{print $3}') + if (( pid > 0 )) ; then + kill -9 "$pid" + else + { orage > /dev/null 2>&1; } & + wmctrl -r "orage" -e "0,$X,$Y,$width,$height" + fi + ;; + esac -echo "$(date '+%a %d %b %T')" +exit 0 -- cgit v1.2.3