diff options
| author | Thomas Irgang <info@tomirgang.de> | 2026-08-16 10:16:46 +0200 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:41:34 -0700 |
| commit | 9423a676432fe9aa40675e4cdf94a4736e6f5a64 (patch) | |
| tree | e0e2999bf9d6a13b5b911bdf7bba992337371fc5 /scripts/lib_apps.sh | |
| parent | f5897674f6f94d39499263a7dd21ffc667abd9ba (diff) | |
fix: Toggle all Waybar clock modules between 12H and 24H (#95)
ToggleWaybarTime.sh matched each clock format with its own hardcoded sed
pattern. Two of those patterns were missing the {:L...} locale prefix that
the corresponding lines in Modules carry:
Modules "format": "{:L%H:%M - %d/%b}"
script "format": "{:%H:%M - %d/%b}"
so clock#3 and clock#4 were never switched. clock#vertical was not covered
at all, because the script only ever edited Modules and never
ModulesVertical. sed -i reports no error when nothing matches, so the
script still restarted Waybar and claimed success while those modules kept
their previous format.
Replace the 18 hardcoded patterns with a table of 12H/24H format pairs and
build the sed expressions from it, so both directions are derived from the
same source of truth. Add ModulesVertical to the files being edited, and
list the Nerd Font glyphs as codepoints (U+F017, U+F073) rather than
literal characters, which are easy to replace with a look-alike from a
different Private Use range without any visible difference.
Warn on stderr about formats that no longer occur in any modules file, and
exit non-zero instead of restarting Waybar when a toggle changed nothing at
all, so future drift surfaces instead of failing silently.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'scripts/lib_apps.sh')
0 files changed, 0 insertions, 0 deletions
