From beddf4eebafe842bcdb45a3e37396f1c2a415cf7 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 10 Feb 2026 16:37:48 -0600 Subject: feat(waybar): split clock into date + world clock modules Replace single clock module with custom/date (calendar tooltip) and custom/worldclock (multi-timezone tooltip from worldclock.conf). Co-Authored-By: Claude Opus 4.6 --- dotfiles/hyprland/.local/bin/waybar-date | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 dotfiles/hyprland/.local/bin/waybar-date (limited to 'dotfiles/hyprland/.local/bin/waybar-date') diff --git a/dotfiles/hyprland/.local/bin/waybar-date b/dotfiles/hyprland/.local/bin/waybar-date new file mode 100755 index 0000000..72a0000 --- /dev/null +++ b/dotfiles/hyprland/.local/bin/waybar-date @@ -0,0 +1,19 @@ +#!/bin/sh +# Waybar date module with two-month calendar tooltip +DATE=$(date '+%a, %b %d %Y') +TODAY=$(date '+%-d') +MONTH=$(date '+%B %Y') + +# Generate current month (with today highlighted) stacked above next month +NEXT_M=$(date -d 'next month' '+%-m') +NEXT_Y=$(date -d 'next month' '+%Y') +CUR=$(cal | sed "s/\b${TODAY}\b/${TODAY}<\/u><\/b><\/span>/") +NEXT=$(cal "$NEXT_M" "$NEXT_Y") +HIGHLIGHTED=$(printf '%s\n%s' "$CUR" "$NEXT") + +TOOLTIP="${HIGHLIGHTED}" + +# Escape for JSON +TOOLTIP=$(echo "$TOOLTIP" | sed ':a;N;$!ba;s/\n/\\n/g') + +printf '{"text": "%s", "tooltip": "%s"}\n' "$DATE" "$TOOLTIP" -- cgit v1.2.3