Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clock.timezone field has no effect #1806

Closed
anarcat opened this issue Nov 21, 2022 · 11 comments
Closed

clock.timezone field has no effect #1806

anarcat opened this issue Nov 21, 2022 · 11 comments
Labels
question Further information is requested

Comments

@anarcat
Copy link

anarcat commented Nov 21, 2022

I have the following modules:

    "clock": {
        "format": "{:%Y-%m-%d %H:%M:%S %Z}",
        "on-click": "exec foot --hold ncal -C -A2",
        "on-click-right": "exec foot --hold ncal -C -y",
        "interval": 1,
    },
    "clock#utc": {
        "format": "{:%H:%M %Z}",
        "on-click": "exec foot --hold undertime --table",
        "timezone": "Etc/UTC",
    },

and they both display show up on the bar. however, the clock#utc widget has the same time as the main clock widget, even though they are supposed to be in different time zones.

here, right now, the local zone (%Z) is UTC-5 (EST), not UTC. Yet both times are identical. The second widget even says it's also showing me EST which leads me to believe the timezone parameter is completely ignored.

I have also tried using the timezones parameter instead, UTC and Iceland as timezones, nothing seems to work. I have also tried to set it for the first clock, no effect.

This is on waybar 0.9.15 on debian testing ("bookworm").

@anarcat
Copy link
Author

anarcat commented Nov 21, 2022

oh and for what it's worth, i don't see an error on output:

nov 21 13:27:16 curie systemd[180736]: Started a nice status bar. 
nov 21 13:27:16 curie nm-applet[181087]: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.615] [info] Using configuration file /home/anarcat/.config/waybar/config 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.616] [info] Using CSS file /home/anarcat/.config/waybar/style.css 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.651] [warning] module backlight: Disabling module "backlight", No backlight found 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.673] [warning] No batteries. 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.673] [warning] No battery named BAT2 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.674] [warning] For a functional tray you must have libappindicator-* installed and export XDG_CURRENT_DESKTOP=Unity 
nov 21 13:27:16 curie waybar[1296290]: ../../../gobject/gsignal.c:2088: type 'GtkWindow' is already overridden for signal id '73' 
nov 21 13:27:16 curie waybar[1296290]: ../../../gobject/gsignal.c:2088: type 'GtkWindow' is already overridden for signal id '72' 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.811] [warning] module backlight: Disabling module "backlight", No backlight found 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.841] [warning] No batteries. 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.842] [warning] No battery named BAT2 
nov 21 13:27:16 curie waybar[1296290]: [2022-11-21 13:27:16.844] [warning] For a functional tray you must have libappindicator-* installed and export XDG_CURRENT_DESKTOP=Unity 
nov 21 13:27:17 curie waybar[1296290]: [2022-11-21 13:27:17.315] [info] Bar configured (width: 1440, height: 24) for output: DP-1 
nov 21 13:27:17 curie waybar[1296290]: [2022-11-21 13:27:17.317] [info] Bar configured (width: 1680, height: 24) for output: HDMI-A-1 

i mean i see a bunch but nothing related to the clock widget, as far as i can tell. looking at the source code, i was expecting this to show up:

    spdlog::warn(
        "As using a timezone, some format args may be missing as the date library haven't got a "
        "release since 2018.");

... but i don't see it... so maybe this is a bug in the date library, as it's the one setting the wtime variable?

  waybar_time wtime = {locale_, date::make_zoned(time_zone, date::floor<std::chrono::seconds>(now) +
                                                                calendar_shift_)};

@Alexays
Copy link
Owner

Alexays commented Nov 25, 2022

Did you try with another timezone just to check?

@Alexays Alexays added the question Further information is requested label Nov 25, 2022
@anarcat
Copy link
Author

anarcat commented Nov 25, 2022

yes, i have just tried America/Cordoba, without luck, for example.

@encbar5
Copy link
Contributor

encbar5 commented Nov 28, 2022

I think "Etc/UTC" is not a valid timezone string. It doesn't work for me either. I tried with "GMT" and "UTC" and they both worked. I also tried with "America/Chicago" and that worked.

@anarcat
Copy link
Author

anarcat commented Nov 28, 2022 via email

@encbar5
Copy link
Contributor

encbar5 commented Nov 28, 2022

Oops, yeah if I run timedatectl list-timezones I get a full list which includes Etc/UTC. I'm using Wabar v0.9.16 on ArchLinux.

@ewollesen
Copy link

ewollesen commented Jan 8, 2023

I'm seeing the same behavior as the original author. I've tried several timezones as well.

Waybar 0.9.9 on Ubuntu 22.04... So I guess my next step is to update to the latest version. The 0.9.9 is what was distributed with Ubuntu.

Update: Using the latest, built from commit c692d7b, works fine.

@anarcat
Copy link
Author

anarcat commented Feb 8, 2023

using the latest in debian (0.9.17) and i still have this problem.

@anarcat
Copy link
Author

anarcat commented Feb 8, 2023

i have also tried with the latest HEAD, no luck still. is there some way i could debug this further? i have tried enabling debugging (log-level=trace), but it doesn't give that much info.

@anarcat
Copy link
Author

anarcat commented Feb 14, 2023

latest HEAD

for the record, that was d259307

@anarcat
Copy link
Author

anarcat commented Feb 19, 2023

i was informed this could be an instance of #1908, which is basically a packaging problem in Debian (or waiting for C++ to modernize, see #668).

workaround:

    "custom/clock": {
        "exec": "TZ=UTC date +'%H:%M %Z'",
        "interval": 5
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants