You can configure GNOME to automatically run applications or scripts when you log in. This method uses GNOME's autostart functionality to execute programs during startup without third-party tools. It applies to any Linux distribution running GNOME, such as Ubuntu, CentOS, or Red Hat.

By creating a simple autostart configuration file, GNOME can execute any script or application you specify. This setup ensures that programs launch automatically on login, simplifying repetitive tasks. For greater control, alternatives like systemd or crontab can be used to run scripts before or independently of login, but for GNOME users, autostart is usually sufficient.

This method is straightforward and allows for easy management of startup programs. No additional tools are required beyond what GNOME offers natively. You only need to specify the application or script and define its execution path within the GNOME startup configuration.

Steps to configure autostart programs for GNOME:

  1. Open GNOME Shell Activities.
  2. Search for and open Startup Applications.
  3. Click on the checkbox to uncheck or click on the Remove button to disable already enabled application from starting during GNOME startup.
  4. Select the Add button to configure a new startup program.
  5. Enter a name and description for the task.
  6. Specify the path to the application or script along with necessary arguments.

    Ensure the user has execute permissions for the specified application or script.
    Related: How to change file and folder permissions in Linux

  7. Click the Add button to finish adding the startup entry to GNOME.
  8. Click on the Close button if you're not adding other startup entries.
  9. Check the generated autostart file to confirm.

    The autostart file will be saved in the user's ~/.config/autostart directory with a .desktop extension.

Discuss the article:

Comment anonymously. Login not required.