Is there a guide on how to autostart programs from the shell?

I need to know the several options and arguments available like how to open specific programs at login as root.

Add them to your shell’s startup files.
Or to your session startup files.
Your “question” is a bit ambiguous.
What is it that you want to do?
And what did you try to do it?

systemd services?

1 Like

I want to open a specific program at login as root. I want to avoid using the Session and Startup program. I didn’t attempt to do it yet.

I was hoping you’d be a bit more specific, but I already said that.

~/.xprofile
could be a good choice
or
~/.bashrc
or
~/.bash_profile

It gets potentially problematic if you want to start a GUI program (as root, no less) …

1 Like

If it is a hidden program, then start it like this:

systemd - ArchWiki
systemd/User - ArchWiki

1 Like

Well it’s a torrent client, GUI yes. I didn’t thought it would make a difference.

Category:BitTorrent - ArchWiki
for example:
Deluge - ArchWiki

no need to run it as root, especially not the gui

it’s not those, it’s BiglyBT, I have to run as root at least once to do updates.

No offense intended, but I’m very sceptical about that.

Can’t help either since I do not know the program.

I’d use the information on how to set up the other ones that are specifically mentioned on the Arch wiki and adapt it for the one you use.
There should also be instructions / a README file or something …

If you installed it from the AUR
you should not use the (probably) built in updater
but rebuild the package and install new versions this way instead.

Just like the updates for your browser - you use the package manager to get a new/recent version
instead of the built in updater …

If you installed it without pacman knowing about it - then you may have to use the built in updater.

1 Like

if you have to run a autostart-script as root a systemd-service is your choice. you will create it and enable it once as root. after this activation it will run. please read carefully the links below:

https://wiki.archlinux.org/title/Systemd

I concur with @Nachlese: running user, graphical applications as root is usually a bad idea.
If you installed it from the package manager, let the latter manage its updates. If you installed it manually, you should rather put it and run it from within your home folder, so that you don’t require superuser privileges to update it either – supposing only your user needs it.