Launch a program at login without permissions (fedora 20)

139 Views Asked by At

I'm currently developing an application with QT 4.8 with a "Launch on login" option. My main problem currently is that I can't seem to find a proper way to make the program launch itself after login on Linux (Fedora 20 in my case).

My program should be able to run in the background without stopping fedora to launch.

I would also like to avoid having to ask for any sort of admin privilege since my application doesn't require any (except maybe for this option).

3

There are 3 best solutions below

0
On BEST ANSWER

Finally found out about "home/.config/autostart/.desktop".

I'll have to create autostart if it's not created but from there I can chose to make or delete the file depending on what my user decided to do.

The .desktop file have to follow a particular syntax (which is not a problem for me)

[Desktop Entry]
Type=Application
Exec=</path/to/binary or command to execute>
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=<Name_to_be_displayed>
Comment=<optional comment>

In my case, I can just remove the "comment" line since just the name of the application should be enough for the user to recognize it.

2
On

You can Either keep your executable in side /etc/rc.d/rs or inside /etc/init.d folder, so that it can automatically start once device is up.

Hope this Helps.

3
On

Each user has a .bashrc file located in their home directory, you could append a command to run your application to the end of that.

That will run when only that user logs in (I think either with graphical or terminal session)

To run for all users, look at creating a systemd service if you dare, or append a line to the end of /etc/rc.local. You'll need to be root for that though.

EDIT: Don't forget to put an ampersand at the end of the command to run in background.