fsobolev / timeswitch

Power off, reboot, suspend, send a notification or execute any command on timer. ⏲️ Written in Python using LibAdwaita.
https://flathub.org/apps/details/io.github.fsobolev.TimeSwitch
Other
36 stars 8 forks source link

[Feature] Continue timer after restarting the system #60

Open hyuri opened 1 year ago

hyuri commented 1 year ago

Hi!

Suggestion: Make timer continue after restarting the system.

Right now, if I restart the system, the timer is lost.

Idea on how it could work (maybe there's a better or proper way):

  1. When timer starts, add command to the Startup folder to launch the app with a flag to start "minimized";
  2. Constantly save a snapshot of the current time into a log;
  3. On system startup, remove command to launch the app from the Startup folder; and take current time and calculate how much time has passed since last time saved to the log;
  4. If there is still time left, continue timer as usual; else: ring the timer
fsobolev commented 1 year ago

I have been thinking about this feature since you suggested it, and I think I won't implement it. This feature is good to have to keep timer in case of unexpected reboot. But it breaks current app purpose: run single task on a timer during current session. Don't get me wrong, extending functionality by adding useful features is a good thing of course. But when it extends functionality in a way that it changes expectations of what should be possible to do, it might be better to not implement such functionality. Like, you don't expect a simple video player to open a video from a torrent file, or e-book reader to edit docx. Maybe these are not the best comparisons, but my point is that I think Time Switch come to the point where it has all features it needs to have (except for a few more changes that are already discussed in other issues). To be more precise on the app purpose design and this particular feature: if we would have an ability to set the timer to launch on the next session, why shoudn't users be able to set a timer for any session? For any day? So this would make the app to be more like full-featured task scheduler, but still very far from it. This feature request and some other comments that I've seen in other places convience me that there is a need in task scheduler for GNOME. If somebody doesn't do it ahead of me, I will work on it. I can't really say when, because there are other projects I'm already involved in (Cavalier, Denaro, Tube Converter, Tagger), but I'm really interested in creating such a new app, not only to make other people happy, but myself too, because in this new project I see some possibilities that will help me grow as hobbyist programmer. 😄 And until the work on the project is started, I will keep this issue open. Sorry for a long message, but I wanted to tell everything I was thinking about. Thanks.

hyuri commented 1 year ago

Understood. Thanks for considering and putting some thought into it!

I also gave the idea some more thought, based on what you said, and I can see how continuing the timer between reboots doesn't make sense for actions such as "Power Off", "Reboot" and "Suspend".

I guess the only counter-point I could give is that the option could make sense if confined only within the "Notification" and "Command" actions — with certain commands that are not session but time-specific, like a backup command you might have scheduled to run at 10 pm.

You've doing really well as a hobbyist programmer, by the way 😁 I've just started using the excellent Tube Converter with the new C# rewrite, and I'm thinking of trying Denaro👌