Software & AppsOperating SystemLinux

How To Add or Change Favorite Apps in GNOME Shell

Ubuntu 1

GNOME Shell is the default interface in GNOME 3, one of the most popular desktop environments for Linux. It’s known for its simplicity and ease of use. However, customizing it to suit your needs can sometimes be a bit tricky. In this article, we will walk you through the process of adding or changing your favorite apps in GNOME Shell.

Quick Answer

To add or change favorite apps in GNOME Shell, you need to locate the .desktop file associated with the application you want to modify. These files contain information about the application and can be found in the /usr/share/applications/ or ~/.local/share/applications/ directories. Once you have located the file, you can edit it using a text editor and modify the "Exec=" line to change the command executed when the application is launched. If you want to add a custom command without replacing the current one, you can add a custom [Desktop Action] in the .desktop file. Alternatively, you can create a new .desktop file for a new favorite app.

Understanding .desktop Files

Before we dive into the steps, it’s important to understand what .desktop files are. These files are essentially shortcuts to applications. They contain information about the application like its name, execution command, and icon. They are usually located in the /usr/share/applications/ or ~/.local/share/applications/ directories.

Locating the .desktop File

If the application you want to add or change appears in the “Activities” overview, it likely has an associated .desktop file. To locate this file, navigate to the /usr/share/applications/ or ~/.local/share/applications/ directories. You can do this by opening the terminal and typing the following command:

cd /usr/share/applications/

or

cd ~/.local/share/applications/

The cd command is used to change directories in a Linux terminal.

Editing the .desktop File

Once you have located the .desktop file, you can edit it using a text editor. If the file is located in /usr/share/applications/, you should first copy it to ~/.local/share/applications/. You can do this using the cp command:

cp /usr/share/applications/filename.desktop ~/.local/share/applications/

The cp command is used to copy files or directories in Linux.

After copying the file, you can edit it using a text editor like nano:

nano ~/.local/share/applications/filename.desktop

In the .desktop file, look for the Exec= line. This is the command that is executed when the application is launched. You can change this to the command you prefer.

Adding a Custom Command

If you want to add a custom command without replacing the current one, you can add a custom [Desktop Action] in the .desktop file. This will make the second command accessible from the context menu (right-click menu).

Here’s an example of how to add a [Desktop Action]:

[Desktop Action Custom]
Name=Custom Command
Exec=custom-command

In this example, Name= is the name that will appear in the context menu, and Exec= is the command that will be executed.

Creating a New .desktop File

If you want to add a new favorite app, you can create a new .desktop file. This file should contain details about the application like its name, execution command, and icon. Here’s an example:

[Desktop Entry]
Name=My App
Exec=/path/to/my/app
Icon=/path/to/my/icon
Type=Application

After creating the file, save it in either /usr/share/applications/ or ~/.local/share/applications/.

Using a GUI Tool

If you prefer using a GUI tool to edit application launchers, you can use alacarte (also known as “Main Menu”). You can install it by running the following command:

sudo apt install alacarte

The sudo command is used to execute commands with root privileges, and apt install is used to install packages.

After installing alacarte, you can launch it and create a new launcher by clicking the “new item” button. You can also edit an existing launcher by finding it in the correct category.

Conclusion

Customizing your favorite apps in GNOME Shell might seem complicated at first, but once you understand how .desktop files work, the process becomes much easier. Whether you prefer editing files manually or using a GUI tool like alacarte, you now have the knowledge to add or change your favorite apps in GNOME Shell.

How do I locate the .desktop file for an application in GNOME Shell?

To locate the .desktop file for an application in GNOME Shell, you can navigate to either the /usr/share/applications/ or ~/.local/share/applications/ directories. You can do this by opening the terminal and using the cd command to change directories. For example, to navigate to the /usr/share/applications/ directory, you can use the command cd /usr/share/applications/.

How do I edit a .desktop file in GNOME Shell?

To edit a .desktop file in GNOME Shell, you can use a text editor like nano. Once you have located the .desktop file, you can open it using the following command: nano ~/.local/share/applications/filename.desktop. This will open the file in the nano text editor, where you can make the necessary changes.

Leave a Comment

Your email address will not be published. Required fields are marked *