4
Autorun | Autostart | Run at startup
(lemmings.world)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
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).
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.
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.
I'm pretty sure that even if systemd is in place you can still use
/etc/init.d