GNOME uses .desktop
files to launch applications. If you want an application to start automatically when the system boots, you need to place a .desktop
file in the ~/.config/autostart/
directory. Follow these steps:
Create the Directory (if it doesn’t exist)
The directory ~/.config/autostart/
is where GNOME looks for autostart files. If this directory doesn’t already exist, you can create it with the following command:
|
|
The -p
flag ensures that the directory is created, even if parent directories are missing.
Copy the .desktop
File
Many applications already provide .desktop
files, which are located in the /usr/share/applications/
directory. These files contain all the necessary information to start the application. You can copy the .desktop
file of the desired application to the autostart directory:
|
|
Replace <application>
with the name of the desired application. For example, to start Firefox at boot, you would enter:
|
|
Edit the .desktop
File (Optional)
If you want to customize the startup parameters of the application, you can edit the copied .desktop
file using a text editor. For example, open the file with nano
:
|
|
Here, you can make changes like adding additional startup options or configuring the autostart for specific conditions. Be sure to save the file after editing.
Test the Autostart
To verify that the application starts automatically on the next boot, you can log out and log back in or restart the system. The application should now start automatically.