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

Allow execution of multiple commands #51

Closed gregorni closed 1 year ago

gregorni commented 1 year ago

If you want to run several commands after a countdown, the only way to do that right now is to make a bash script and then run that. It would be nice if you could just enter & select the commands you want to run.

I guess you could use ; to put several commands in a single line, but that's not as organized.

fsobolev commented 1 year ago

It's hard for me to imagine a real example when a user would need this. The purpose of Time Switch is to allow regularly run tasks, not just replace sleep N && ... in command line. If a user needs to regularly execute a set of commands or sometimes just some commands from the set, it makes sense to create 2 or more commands in Time Switch and run whatever is needed. But also there are questions on how should this work and how to provide enough control in the UI. Should commands be executed at the same time in parallel or one by one? If the latter, then in what order? Should commands be executed no matter what or stop after some command failed? In scripts a user can control everything. So my conclusion is that this is out of scope of the app. I understand that some people would like to have a whole replacement for cron, set a lot of different commands, run them not only after a countdown timer but at some time in some days of week or month, but Time Switch has a simpler purpose: to run a task after a timer during current session. If somebody thinks this feature is really needed in Time Switch, I'm open to discussion to convince me that it's really useful, and some ideas how all the problems I mentioned above should be resolved would be helpful. But for now I'm closing this as not planned.