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

Interval should align with actual time. #486

Open
iguanajuice opened this issue Jul 28, 2024 · 1 comment
Open

Interval should align with actual time. #486

iguanajuice opened this issue Jul 28, 2024 · 1 comment

Comments

@iguanajuice
Copy link

If you set an interval of 5 seconds, it should run every 5 seconds on the clock.

An example config like this:

[date]
command=date
interval=5

might currently output like so:

Sun Jul 28 01:18:07 PM EDT 2024
Sun Jul 28 01:18:12 PM EDT 2024
Sun Jul 28 01:18:17 PM EDT 2024
...

instead of like this:

Sun Jul 28 01:18:05 PM EDT 2024
Sun Jul 28 01:18:10 PM EDT 2024
Sun Jul 28 01:18:15 PM EDT 2024
...

This is especially desired for minutely and hourly intervals; with i3blocks's current behaviour, setting a command to run every hour won’t run when the hour actually changes on the clock.

@gportay
Copy link
Contributor

gportay commented Jul 29, 2024

I do not think it should.

TBH, i3block is scheduler spawning scripts starting counting since it is started.

Synchronizing the start on the second zero and maintaining it is complex since the date time may be reset after i3block is started (either by yourself, ot the by the NTP, or whatsoever).

Having such feature is resteicted to block let outputting the date time, and thus it is not very general purpose.

The example you took is a very simple example. If you want kind of human alignment syncing, you have not choice but to set interval to 1 to output the current time every seconds.

And remember, that the output will never be the actual time since it it never sync on actual time.

However, you have all you need to implement your request yourself within a block let, using the persistent block let.

Furthermore, how should i3block behave with a 7 second interval for the second minute? i.e. a 60s modulo interval that is not zero. Does it break the 7 interval to sync up with the next zero second? Or should it output HH:mm:02 (If I know counting)?

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

No branches or pull requests

2 participants