Unlike Windows, Ubuntu doesn’t automatically add desktop shortcuts for the apps you install. While this might not cause problems for experienced Linux users, those who come from Windows can find this behavior strange, provoking them to switch back to their old OS. After all, who wouldn’t want the convenience of launching their apps directly from the desktop—that’s what a desktop is for!
In this guide, you’ll learn how to create and add application shortcuts to the Ubuntu desktop. Let’s delve right into it.
Why Create Desktop Shortcuts on Ubuntu?
There are a plethora of reasons why one would want app shortcuts on their desktop. The most prominent amongst all is convenience. Having a desktop full of shortcuts ensures you don’t have to open the applications menu and search for an app every time to launch it.
And also, you can steer clear of the sophisticated terminal-based approach to launching apps, which is nerve-wracking for some beginners.
Other mainstream OSes like Windows also employ app shortcuts to enrich the user experience and make it easy for users to launch applications straight from the desktop. Usually, you get the choice to create a shortcut for the app during its installation.
Linux distros, especially Ubuntu, don’t offer such features, which is why users might want to create shortcuts to make their Linux experience as close to Windows as possible.
Perhaps you’ve written a script and need to run it frequently, without going through the hassle of opening the terminal, navigating to the folder, and executing it. You can choose the easy way by setting up a launcher for the script on the desktop. Then, whenever you want to run your script you can simply double-click the shortcut.
To create application launchers on Ubuntu, all you have to do is copy and paste the .desktop file (more on this later) to your desktop.
Adding an Application Shortcut on Ubuntu
On Linux distros, files ending with .desktop are called desktop files. These are simple configuration files that hold information about an application, including its path, icon, and other metadata. You can think of them as app shortcuts on Ubuntu. Note that, however, these are not limited to only applications, you can also create such files for directories, URLs, and scripts.
The /usr/local/share/applications directory stores desktop files for programs installed on your system. If an app has been installed for only a single user, the desktop entry for the said app can be found inside the ~/.local/share/applications folder inside the user’s home directory.
This guide will demonstrate setting up app shortcuts stored in the /usr/local/share/applications directory. The steps are exactly the same for desktop files stored in any other directory on the system.
To start, head over to the /usr/local/share/applications directory using either a graphical Linux file manager or the command line. Then, inside the folder, locate the desktop entry for the application you want to create a shortcut for.
When found, copy and paste the desktop file to your desktop. You can do so from the terminal using the following command:
cp /usr/share/local/applications/app.desktop ~/Desktop/
For example, let’s copy Rhythmbox’s desktop entry to the desktop:
cp /usr/share/applications/rhythmbox.desktop ~/Desktop/
After moving the file, you’ll notice that the shortcut has no icon. To fix this, right-click on the file and select Allow Launching from the context menu that appears.
Note that not all desktop entries will be executable and include an icon. Although you can find the desktop files for terminal-based programs in the /usr/share/local/applications folder, you won’t get the Allow Launching option when you right-click on the file after moving it to the desktop.
Manually Creating a Desktop Entry
Not every Linux program will create a desktop entry for you. But you can create one for any app installed on your system. The format of the desktop file is easy to understand, and almost anyone can effortlessly write one themselves.
For this guide, we’ll create a desktop entry for the Ubuntu Terminal. Start by creating a new file using the touch command.
Then, open the file in your favorite text editor for editing. The very first statement inside the file would define that it is a desktop entry file.
The next section defines the version details and other metadata associated with the app.
Comment[en_US]=A terminal emulator for the shell
In the following section, add the path of the executable and other necessary information. For the “Exec” variable, you can simply add “gnome-terminal” since typing this command would yield another terminal instance.
If you haven’t added the app to your environment variables, you can also specify the complete path of the binary. For other applications, change the variable values as you prefer.
You can also add the source and icon path for the app. If not added, Ubuntu will automatically assign a default icon to the shortcut.
The next section deals with the type of desktop entry and the categories it belongs to. Fill in the details as follows:
Save the file and move it to the desktop. Then, right-click on it and select Allow Launching to make it an executable. You can then double-click the shortcut on your desktop anytime to launch the application.
Note: If the app for which you created the entry doesn’t show up in the applications menu, consider copying the desktop file to the /usr/share/applications and ~/.local/share/applications directory.
Ensuring Easy Access to Apps on Ubuntu
Ubuntu has tried making the Linux experience welcoming for newcomers. And to some extent, it has been quite successful in doing its job. But also, it’s a lot different than other mainstream OSes in many aspects.
While you might find some Windows-exclusive features unavailable on Ubuntu, there are a lot of things Ubuntu does better than Windows.
Is Ubuntu really just for nerds? No! Ubuntu is as easy to use as Windows… and in some ways, Ubuntu is better than Windows 10!
About The Author