Alexays / Waybar

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

Drop date dependency and use C++20 (once compilers support it) #668

Open b1rger opened 4 years ago

b1rger commented 4 years ago

Hi,

according to https://github.com/HowardHinnant/date/issues/565 C++20 seems to implement the functionality of the date library, that Waybar uses. Most compilers don't fully implement C++20 yet, but when they do, it would probably make sense to drop the dependency.

(For transparency: I've uploaded releases of waybar to Debian in the past, but at the moment I'm blocked by the missing date dependency. I looked into packaging date, but given the fact that its functionality will be provided by C++20 I'm not sure it makes much sense.)

Alexays commented 4 years ago

I'll go 100% on C++20 once possible!

nschloe commented 4 years ago

I've worked on waybar for debian and definitely can say that the dependency on hhdate hinders waybars adoption. It'd help waybar's distribution if the dependency on hhdate was optional, even if that costs timezone support.

b1rger commented 3 years ago

Just for the record, I've uploaded waybar to Debian unstable, but for now it is compiled without the clock module. I have added a README to the Debian package, pointing out that the clock module is missing and that some of its functionality can be replaced by the custom module.

nschloe commented 3 years ago

I've packaged hhdate and waybar to get the full functionality. Here's the PPA. FWIW it might be ready for inclusion into debian.

diraol commented 3 years ago

Hi @b1rger can you give me a hand setting up the clock using the custom module, please?

I've done it this way:

{
    "layer": "top",
    "position": "top",
    "height": 26,
    "modules-left": [
    ],
    "modules-center": [
        "custom/clock"
    ],
    "modules-right": [],
    "custom/clock": {
        "exec": "date '+%Y-%m-%d %H:%M'",
        "format": "{}",
        "interval": "45"
    }
}

It almost work, but once the clock is initialized it does not update anymore, even though having the interval set. I am not sure what I'm doing wrong here. :disappointed: Any tips?

Oh, I've also tried restart-interval instead of only interval.

b1rger commented 3 years ago

Hi @b1rger can you give me a hand setting up the clock using the custom module, please?

I'm not sure, maybe drop the format? This works for me:

    "custom/clock": {
        "exec": "date +'%H:%M %S'",
        "interval": 5
    },
jacksgt commented 3 years ago

@b1rger Thanks for the Debian package and the example snippet. Maybe next time you can put this info into the changelog (instead of README.Debian), so users get notified when the upgrade (apt-listchanges).

@diraol I had the same issue. It's because you've specified the interval as a string ("45"), but it should be an integer:

"interval": 45
diraol commented 3 years ago

@diraol I had the same issue. It's because you've specified the interval as a string ("45"), but it should be an integer:

"interval": 45

Oh man! :facepalm: thanks for spotting it!

kit-ty-kate commented 3 years ago

Any update on this? The lack of a clock module in Debian is rather annoying

charliebarber commented 3 years ago

Getting unknown module clock on Debian Bullseye

ulysses4ever commented 3 years ago

@kit-ty-kate @charliebarber have you seen this comment above:

I've packaged hhdate and waybar to get the full functionality. Here's the PPA. FWIW it might be ready for inclusion into debian.

The PPA worked like a charm for me.

LukashonakV commented 1 year ago

Hi @b1rger , @Alexays, @alebastr , looks like finally this issue is satisfied and can be closed. See PR#1959 and PR#1971

jm355 commented 1 year ago

Starting waybar I get this error, is it related to this issue? [2023-05-27 11:26:45.079] [warning] As using a timezone, some format args may be missing as the date library haven't got a release since 2018.

zjeffer commented 1 year ago

Should this line not be changed? https://github.com/Alexays/Waybar/blob/master/meson.build#L7

Why did those PRs not change that to c++20? I don't have c++20 features unless I change that line. @LukashonakV

EDIT: I figured out that I can pass this as an option to the meson setup command, but maybe we should set c++20 as the default now?