Sometimes you may want to launch a program automatically when you log in to your Linux desktop. Such start-up programs can conduct system-wide configuration (e.g., auto proxy) or user-specific desktop customization (e.g., Conky), at the time you log in to your desktop.
Most Linux desktop environments have their own GUIs that allow users to configure user-specific auto-start programs or services.
In this tutorial, I will describe how to start a program automatically in various Linux desktop environments.
GNOME Desktop Environment
Run this command in a terminal to launch "Startup Applications Preferences" GUI.
Click on "Add" button to configure a new startup application. Type in the name of the app, and the CLI command for the app, in "Name" and "Command" fields respectively. Type in optional description in "Comment" field.
Unity Desktop Environment
Type "startup" in Unity Dash. Once "Startup Applications" icon appears, click on it.
Once "Startup Applications Preferences" window opens up, enter "Name", "Command" and "Comment" to configure a program to auto-start.
KDE Desktop Environment
First, open up "System Settings" window. You will find "Startup and Shutdown" icon under System Administration. Click on the icon.
You will be asked to choose an application to auto-start among a list of known applications. If your program is not listed, enter the name of the program in the top blank. If the program (e.g., CLI command) shall be run in a terminal, turn on the checkbox for "Run in terminal". Click on "OK" button.
Next, you will be asked to enter the detail of the app, including name, command, and description.
After this, you will see that the program is configured to run on start-up. To configure additional start-up programs/scripts, you can click on "Add Program" or "Add Script" buttons in the right sidebar.
MATE Desktop Environment
On MATE desktop, go to "Applications" -> "Preferences" -> "Startup Applications"
You will see "Startup Applications Preferences" window. Click on "Add" button.
Enter the detail of a startup program: "Name", "Command" and "Comment".
Xfce Desktop Environment
Choose "Settings Manager" from Xfce desktop menus. In "Settings" window, click on "Session and Startup" icon.
Under "Application Autostart" tab, click on "Add" button at the bottom.
Enter the detail of a program to auto-start: "Name", "Command" and "Description".
LXDE Desktop Environment
To configure a start-up program on LXDE desktop environment, run the following commands in a terminal.
$ touch ~/.config/lxsession/Lubuntu/autostart
$ leafpad autostart
Then add the following entry to the created autostart file:
Here, "conky" is the name of the CLI command that I want to auto-run upon log in.
Save and close.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Latest posts by Dan Nanni (see all)
- How to install Suricata intrusion detection system on Linux - September 3, 2015
- How to switch from NetworkManager to systemd-networkd on Linux - August 31, 2015
- How to set up a system status page of your infrastructure - August 25, 2015