From f0b527f61e251a879a179ff4fef16baaa486c047 Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Tue, 3 Jun 2025 19:56:25 +0200 Subject: update --- pw-date | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 pw-date (limited to 'pw-date') diff --git a/pw-date b/pw-date new file mode 100755 index 0000000..10593c4 --- /dev/null +++ b/pw-date @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# X220 screen is 1366x768 +width=300 +height=180 +X=$((1366-width)) +Y=24 # bar height + +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) + TODAY=$(date '+%-d') + HEAD=$(cal | head -n1) + BODY=$(cal | tail -n7 | sed -z "s|$TODAY|$TODAY|1") + + dunstify "$HEAD" "$BODY" \ + -i office-calendar-symbolic \ + -h string:x-canonical-private-synchronous:calendar \ + -u normal + ;; + + +esac + +echo "$(date '+%a %d %b %T')" -- cgit v1.2.3