Transferred from: http://os.51cto.com/art/201401/426464.htm
Sometimes, when you log in to the Linux desktop, you may want to start a program automatically. These start-up programs can be configured for an entire system (such as an automatic proxy), or customized for a specific user's desktop (such as Conky), after you log in to the desktop.
Most Linux desktop environments have their own graphical user interface (GUI) that allows users to configure automatic startup programs or services for specific users.
In this tutorial, I'll show you how to start a program automatically in a variety of Linux desktop environments.
GNOME Desktop Environment
Run this command in the terminal to start the "Startup Applications Preferences" (Launch application Preferences) GUI.
- $ gnome-session-properties
。
- $ gnome-session-properties
Click the "Add" button to configure a new launch application. Type the name of the application and the CLI command for the application, respectively, into the Name column and command bar. Type an optional description into the "Comment" (note) column.
Unity Desktop Environment
Type "startup" in Unity Dash. Once the "Startup Application" icon appears, click on the icon.
Once the startup applications Preferences (Launch Application Preferences) window opens, enter "name", "command", and "Comment" (note) to configure a program that starts automatically.
KDE desktop Environment
First, open the System Settings window. You will find the "Startup and Shutdown" (Start and close) icon under System administration. Click the icon.
You will be asked to select an application that starts automatically from a list of known applications. If your program is not listed, enter the name of the application in the blank area above. If the program (such as a CLI command) will run in the terminal, select the run in terminal (running in terminal) check box. Click the "OK" button.
Next, you are asked to enter the details of the application, including the name, command, and description.
After that, you will see that the program has finished configuring and can be run automatically. To configure an additional launcher/script, you can click on the "Add Program" button or the "Add Script" button in the right sidebar.