diff options
Diffstat (limited to '')
| -rwxr-xr-x | .config/waybar/module-calendar.sh | 29 |
1 files changed, 29 insertions, 0 deletions
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 '{}' |