Ubuntu – How to start applications automatically on login
autostart
How can I make an application automatically start when I have logged in?
Best Answer
20.04 and later
If not yet done by default install gnome-startup-applications
Search and open "Startup Applications"
click add to enter the command including options of your application as you would run it from terminal (you may have to give in the full path if it runs from a non-standard location)
This will add a .desktop file in your ~/.config/autostart
14.04 and later
Open the Dash and search for "Startup Applications"
Now click on Add and give in the command to run the application. This can be found in Main Menu if installed (see below)
Using Main Menu (alacarte) to find the terminal command to run a given program:
Firstly open the program 'Main Menu' (type Menu in the Dash)
Now select the program which you want to add to startup and click on properties .
Now note the command for that program .
Non GUI approach
Advanced users may want to manually put a .desktop file in ~/.config/autostart to run applications after a user login. This may have following content:
[Desktop Entry]
Type=Application
Name=<Name of application as displayed>
Exec=<command to execute>
Icon=<full path to icon>
Comment=<optinal comments>
X-GNOME-Autostart-enabled=true
You may have to give this file execute permission.
kstart --iconify <program name> in KDE starts minimized. I really don't know if there is a specific command to close to systray (even because many apps don't have a systray).
Another possibility is using ksystray. For example ksystraycmd --hidden kmail will start kmail and put it in the system tray. But i'm not quite sure if it will work for any app.
If not, probably you have to check if there is a specific option for your application.
Best Answer
20.04 and later
gnome-startup-applications
.desktop
file in your ~/.config/autostart14.04 and later
Using Main Menu (alacarte) to find the terminal command to run a given program:
Menu
in the Dash)Non GUI approach
Advanced users may want to manually put a
.desktop
file in~/.config/autostart
to run applications after a user login. This may have following content:You may have to give this file execute permission.