aboutsummaryrefslogtreecommitdiff
path: root/pw-date
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-06-03 19:56:25 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-06-03 19:56:25 +0200
commitf0b527f61e251a879a179ff4fef16baaa486c047 (patch)
tree643a5717fcf243c5430cf8b0609d23bd2fa41b59 /pw-date
parent95a142be5215939fc6b5be643e4fa44650415e2c (diff)
downloadscripts-f0b527f61e251a879a179ff4fef16baaa486c047.tar.gz
scripts-f0b527f61e251a879a179ff4fef16baaa486c047.tar.bz2
scripts-f0b527f61e251a879a179ff4fef16baaa486c047.zip
update
Diffstat (limited to 'pw-date')
-rwxr-xr-xpw-date34
1 files changed, 34 insertions, 0 deletions
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|<u><b>$TODAY</b></u>|1")
+
+ dunstify "$HEAD" "$BODY" \
+ -i office-calendar-symbolic \
+ -h string:x-canonical-private-synchronous:calendar \
+ -u normal
+ ;;
+
+
+esac
+
+echo "$(date '+%a %d %b %T')"