From d4620f3ac119263fee90bd819eadaf84fc8d50b7 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Wed, 8 Apr 2026 13:11:48 +0900 Subject: * MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automated-commit-by: dots Signed-off-by: Robert Günzler --- .config/waybar/module-calendar.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 .config/waybar/module-calendar.sh (limited to '.config/waybar/module-calendar.sh') diff --git a/.config/waybar/module-calendar.sh b/.config/waybar/module-calendar.sh new file mode 100755 index 0000000..6b20e2f --- /dev/null +++ b/.config/waybar/module-calendar.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -eu +[ -n "${DEBUG:-}" ] && set -x + +shopt -s extglob + +update() { + local today tn + local text + + # get events + today=$(~/src/calsync/ics2calendartxt ~/calendars/**/**/* 2>/dev/null | + grep -I "$(date -I)") + [ -z "$today" ] && return + + tn=$(wc -l <<<"$today") + + # text="$today" + # text="${text##"$(date +'%Y-%m-%d w%V %a ')"}" + # text="${text##+([^ ]) }" + + text="󰃭 $tn" + + jq -nrc '{text:$text,tooltip:$tip}' \ + --arg tip "$today" \ + --arg text "$text" +} + +update || echo '{}' -- cgit 1.4.1