Search

Chapter 2. Setting up startup applications in GNOME

download PDF

In the GNOME desktop environment, you can add applications to start automatically upon logging in, meaning that the application launches automatically every time you log into your GNOME desktop session.

2.1. Launching an application automatically on login

You can set applications to launch automatically on login using the Tweaks tool. Tweaks is a tool to customize the GNOME Shell environment for a particular user.

Prerequisites

  • You have installed gnome-tweaks on your system. For more details, see Installing software in GNOME
  • You have installed the application that you want to launch at login.

Procedure

  1. Open Tweaks. For more details see Launching applications in GNOME.
  2. Select Startup Applications in the left side bar.

    Select Startup Applications

  3. Click the plus sign button (+).

    Click plus sign button

  4. Select an application from the list of available applications and click Add.

    Add application

Verification

  1. Open Tweaks.
  2. Select Startup Applications in the left side bar.
  3. List of applications launched at start will be present in the center section.

    Select Startup Applications

Additional resources

2.2. Enabling startup applications for another user in GNOME

You can set up a startup application to run for specific users on a system. This will automatically start the specified application for the target user when they log in.

Prerequisites

  • Administrative access.

Procedure

  1. Locate the .desktop file in the /usr/share/applications/ directory that corresponds to the application you want to start automatically.
  2. As the root user, copy the .desktop file to the /home/<targetuser>/.config/autostart/ directory:

    # cp /usr/share/applications/<yourapp>.desktop /home/<targetuser>/.config/autostart/

    Replace <yourapp> with the name of your application. Replace <targetuser> with the username.

  3. Ensure that the .desktop file is owned by the target user and has the correct permissions:

    # chown <targetuser>:<targetuser> /home/<targetuser>/.config/autostart/<yourapp>.desktop
    # chmod 644 /home/<targetuser>/.config/autostart/<yourapp>.desktop

    Replace <targetuser> with the username. Replace <yourapp>.desktop with the .desktop file you copied.

Verification

  • The target user should log out of their GNOME session and log back in. The application specified in the .desktop file should start automatically.

2.3. Enabling system-wide startup applications for all users in GNOME

You can set up a startup application to run for all users on a system by placing the .desktop file in a system-wide directory that is accessible to all users. This will automatically start the specified application for every user who logs in.

Prerequisites

  • Administrative access.

Procedure

  1. Locate the .desktop file in the /usr/share/applications/ directory that corresponds to the application you want to start automatically.
  2. As the root user, copy the .desktop file to the /etc/xdg/autostart/ directory:

    # cp /usr/share/applications/<yourapp>.desktop /etc/xdg/autostart/

    Replace <yourapp> with the name of your application.

  3. Ensure that the .desktop file has the correct permissions to be read by all users:

    # chmod 644 /etc/xdg/autostart/<yourapp>.desktop

    Replace <yourapp>.desktop with the .desktop file you copied.

Verification

  • Users on the system should log out of their sessions and log back in. The application specified in the system-wide .desktop file should start automatically.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.