Desktop shortcuts provide easy access to frequently used applications or folders. If you have been using Windows or Mac, then this concept should sound familiar. Linux users can still benefit from using desktop shortcuts by creating them on their Linux systems.
By default, Ubuntu provides application shortcuts on Ubuntu launcher. However, not everyone finds this convenient, especially those used to working on Mac or Windows. Some prefer creating desktop shortcuts.
In this guide, we learn how to create desktop shortcuts on Ubuntu desktop. For demonstration purposes, we are using Ubuntu 22.04 with GNOME desktop environment.
Create a desktop shortcut from existing .desktop files
One approach you can use to create desktop shortcut ubuntu desktop is by copying a desktop file from the location /user/share/applications directory and pasting it on the desktop.
To start off, launch your terminal and run the following command by providing the full path
$ nautilus /usr/share/applications
This opens the applications folder using the Nautilus file manager. Inside the directory, you will find multiple .desktop files for system and user-installed applications. For this guide, we will create a desktop shortcut for VLC media player.
So, locate the desktop file and copy the desktop file as demonstrated.
Next, head back to the Desktop, right-click and paste the file.
Once pasted, this creates a new desktop entry which is the application's shortcut. However, unlike windows, the desktop shortcut appears grayed out. This means that it is not yet active.
To enable it, right-click on the shortcut and select 'Allow launching'.
This time around, the icon will appear normally as you find it on any other operating system. To launch the application, simply double click on the desktop icon on your Linux system.
This is how you go about creating desktop shortcuts using a desktop file.
Create a desktop shortcut for snap applications
For programs installed from snap, the path to the .desktop file is located at the /var/lib/snapd/desktop/application/ directory. Therefore you need to copy the desktop file from that directory to the desktop.
For example, if you have Spotify installed as a snap application, navigate to the /var/lib/snapd/desktop/application/ path and copy the Spotify desktop file and paste it to your desktop. Then allow launching as we have demonstrated.
Below is the Spotify application shortcut.
Create a desktop shortcut to files or folders
So far, we have seen how to create desktop shortcuts to applications. Additionally, you can add desktop shortcuts to files or folders.
To create a desktop shortcut to a file or a folder, create a symbolic link of the file or folder to the desktop folder.
For example, to create a desktop shortcut to a file called file.txt that resides in the Documents folder, run the following command.
$ ln -s ~/Documents/file.txt ~/Desktop/
Similarly, run use the same syntax when creating a folder shortcut. In this example, we are creating a desktop shortcut to the 'sales' directory.
$ ln -s ~/Documents/sales ~/Desktop/
Create a desktop shortcut to an AppImage
Just like snap, AppImage is a universal package manager that packages software in a .AppImage format. However, unlike snap, an AppImage does not require root privileges to install. As a matter of fact, it does not require any installation. You simply execute after assigning execute permissions.
As an example, we will download the GIMP AppImage file. Click on the 'Download' file to download the AppImage to your ~/Downloads directory.
Once downloaded, head over to the ~/Downloads directory, right-click on the AppImage file and select 'Properties'. Click on the 'Permissions' tab and check the 'Execute' option that allows the file to be executed as a program.
Also, download a GIMP icon and place it in the same directory as the AppImage.
Next, launch the terminal and create a GIMP desktop file in the /usr/share/applications path using nano editor.
$ sudo nano /usr/share/applications/gimp.desktop
Paste the following lines of code and be sure to specify your own 'Exec' and 'Icon' paths.
[Desktop Entry] Name=Gimp Exec=/home/user/GIMP_AppImage-git-2.10.21-20201001-withplugins-x86_64.AppImage Icon=/home/user/Downloads/gimp.jpg comment=Raster Graphics Editor Type=Application Terminal=false Encoding=UTF-8 Categories=Utility;
Save and exit the file. Next, copy and past the desktop file to the desktop as shown in previous examples.
Thereafter, right-click on the file and select 'Allow launching'. This activates the application icon, just like the previous desktop icons. Then double-click the icon to launch GIMP.
The icon also gets placed in the applications menu.
We hope you had a great time learning how to add application shortcuts on ubuntu. As you have seen creating shortcuts is quite easy and takes a few simple steps. Thanks, and have fun.