SwiftBar icon indicating copy to clipboard operation
SwiftBar copied to clipboard

Feature request: seconds support for scheduling

Open byung806 opened this issue 1 year ago • 5 comments

For many timer/countdown apps, it is necessary to update the menu bar text every second. Unfortunately, cron syntax only supports down to minutes (due to only checking for cron tasks every minute on Linux).

However, this app is able to update every second. I am suggesting an expansion to the scheduling functionality for seconds: Existing: (0-59) (0-23) (1-31) (1-12) (0-6) (minutes, hours, days, month, weekday) Suggested: (0-59) (0-59) (0-23) (1-31) (1-12) (0-6) (seconds, minutes, hours, days, month, weekday)

byung806 avatar Feb 09 '24 18:02 byung806

Hey @byung806, you know that you can configure schedule using special syntax in the file name? There is support for seconds and even milliseconds.

I'm using a small thirdparty library for cron-syntax parsing and I would rather not touch it.

melonamin avatar Feb 11 '24 14:02 melonamin

Yes, I'm aware of using 1s or 1ms to update the item every second/ms, but I haven't figured out a way to only update when needed. For context, I'm making a script that tracks how much time is left in my period at school (counts down to the next bell). It would need to update every second while school is going on, but when there's no school, for example on the weekends, I don't want the app to update at all. Is this possible using the name special syntax? Or a combination of the name syntax with the scheduling cron syntax?

byung806 avatar Feb 11 '24 18:02 byung806

Ah, I see. No, it is not possible with the current feature set.

Let me think about it.

melonamin avatar Feb 11 '24 20:02 melonamin

Please let me know if this becomes possible. Thank you for your efforts!

byung806 avatar Feb 12 '24 05:02 byung806