Autorun | Autostart | Run at startup
from conductor@lemmings.world to programming@programming.dev on 03 May 17:45
https://lemmings.world/post/8709913

Many commertial apps have options to run apps at logins… Is there any cross-platform way to do so in python or other languages?

#programming

threaded - newest

best_username_ever@sh.itjust.works on 03 May 17:50 next collapse

Too specific I guess.

xmunk@sh.itjust.works on 03 May 17:54 next collapse

The ways to register programs to run at startup vary wildly from platform to platform but they’re all relatively simple. I might suggest you just look into how to do it manually before looking for a library since it’s extremely trivial (at least on windows/Linux - I’m not familiar with how macs do it but I hope it’s the same approach as linux).

bitfucker@programming.dev on 04 May 09:38 next collapse

If it is trivial in linux, it shouldn’t be vary wildly. But the reality is that most people just assume systemd and everything else is an after though. I agree that it would be nice if there is a single API that we can agree on, but adding another standard just making things worse. I’d say it is not that trivial due to the variety but also not that hard to do for each.

xmunk@sh.itjust.works on 04 May 19:20 collapse

I’m pretty sure that even if systemd is in place you can still use /etc/init.d

Miaou@jlai.lu on 08 May 10:39 collapse

Extremely trivial? Init stuff probably shouldn’t be touched by random user app, systemd cannot always be assumed, login shell can probably do this but syntax will vary by shell, and the only other I can think of is WM dépendent (although I assume the big ones will agree on using desktop files, i3 for example does not, and location might vary there too).

It’s not difficult but to handle this generically requires some work to handle various scenarios.

bizdelnick@lemmy.ml on 04 May 07:28 collapse

No.