Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.67k stars 709 forks source link

Hour without leading zero in clock module? #3097

Open tmpm697 opened 7 months ago

tmpm697 commented 7 months ago

hi, it seems that i can't set to have hour without leading zero with clock module @alttabber @LukashonakV it will echo clock: chromo format erorr: invalid specifier in chromo-specs

I have:

"format": "{:%a %b %d %-H:%I %p}",

expect output: Sun Mar 31 1:20 AM --> no leading zero in hour 1

ordy commented 7 months ago

See #1469 (also https://github.com/fmtlib/fmt/issues/3572)

Have to wait for next fmt release a new update to support %-H and %-I.

hhhorb commented 6 months ago

Still an issue with today's release...

alttabber commented 6 months ago

Still an issue with today's release...

It's an upstream problem with https://github.com/fmtlib/fmt, if you wanna bug someone bug them.

hhhorb commented 6 months ago

@alttabber, I'm not trying to bug anybody, I'm just trying to get a clock display that 300 million Americans use daily. Also the UK, Ireland, Canada, Australia, Japan, India, Philippines, Mexico... I think even those old analog flip clocks with the digital chiclets in the '80s had a blank chiclet for 1-9 o'clock. I'm trying to get a clock display that I can get on every other clock applet and panel I've used. Nobody who uses a 12-hour clock displays it or says it as 02 o'clock.

I don't understand,is this not a regression...

https://github.com/Alexays/Waybar/issues/1469

So apparently this worked in waybar 9.12 or before. And entering date +%l:%M in a terminal displays the time properly...

❯ date +%l:%M
 1:19

If this is a fmt issue and they've stalled on it... https://github.com/fmtlib/fmt/issues/2959

... why continue to use that library for waybar-clock? Like I said, xfce4-panel, GNOME, KDE, lxpanel, tint2, awesome panel, conky, etc... all can display a 12-hour clock without a leading zero.

jayache80 commented 6 months ago

Recommend collapsing this issue with https://github.com/Alexays/Waybar/issues/1469

libfmt has supported stripping the leading zero using - (e.g. {:%-I:%M}) since Feb of 2023:

commit 7718eeeacc98c2dfb6fe8714fb38ef31f2921ab9
Author: Shawn Zhong
Date:   Wed Feb 8 11:22:58 2023 -0600

    Implement glibc ext for sec, min, and hour (#3271)

But you'd want a new libfmt release before you'd want to use it (latest libfmt release 10.2.1 has this bug which is fixed but not released).

Once that's released, then waybar project would have to pick up that release.

hhhorb commented 5 months ago

@jayache80, thanks much for the update.