Ubuntu create desktop shortcut to terminal command

Unlike Windows, creating a desktop shortcut on the Ubuntu Linux system for installed applications is not pretty simple. Of course, it is not some Sisyphean task but as compared to Windows, it would be a little tricky for new Linux users.

Furthermore, we cannot just drag and drop applications from the Ubuntu launcher to create their desktop shortcuts, then how to add application shortcuts in Linux Desktop?  Well, for that we manually have to visit the applications folder on our Linux system to copy the .desktop file of an installed application.

Also, See: Create Ubuntu install Android Studio Linux Desktop Shortcut and Command-Line launcher

Add a Desktop shortcut in Ubuntu 20.04 LTS Linux

Do you want to put working folders and frequently used applications on the desktop? We can easily accomplish this on the default Gnome desktop by adding Applications shortcuts, follow the below steps.  You can follow this tutorial for other Linux distributions as well.

1. Open Ubuntu File Manager

Although we can navigate to the folder where all applications .desktop files are available using the command terminal, however, to make the tutorial easy, we are using GUI. Thus, click on the Folder icon given on the Dock of Ubuntu and then select Other locations. 

2. Go to the Applications folder

Now, click to open Computer and navigate to open the Applications folder. Usr ⇒ Share ⇒ Applications.

3. Copy .desktop file of the application

Inside the Applications folder, you will see the .desktop file for all programs installed on your Ubuntu 20.04 or in any previous version you are using. What you have to do just copy the file of the application that shortcut you want to create on your Ubuntu Linux Desktop. For example- I want to create a desktop shortcut for the Firefox browser, thus to do that I will copy its file and paste it on the Desktop.

4.  Create a Desktop shortcut on Ubuntu 20.04

Once you paste the .desktop file of some application on the Ubuntu desktop you will have the shortcut but to run it we have to perform one more step. Simply, right-click on it and select the “Allow launching” option.

Finally, you will have an application shortcut icon on the Ubuntu desktop.

 Video Tutorial

May steps given above are not clear to you, thus watch the video tutorial to clearly understand the way to add desktop shortcuts on Ubuntu Linux.

Other Articles:

The desktop is the first thing that greets the user when they login to their computer. It’s the reference point for all your navigation. Speaking of which, navigation can be made much easier through shortcuts. Most users prefer to put shortcuts to various applications on the desktop to launch applications quickly. This way, they don’t have to go looking for them in their corresponding directories.

On Windows, many application installers prompt the user to add a shortcut to the application on the desktop. If the user didn’t accept the option, the shortcut could be created simply by navigating the application’s .exe file, right-clicking on it, selecting Send To, and then Desktop [create shortcut]. However, executing the same thing on Linux is slightly more complicated.

Most of the popular Linux desktop environments like KDE Plasma, XFCE, and Cinnamon also allow users to add their favorite application shortcuts on their desktop. On the other hand, GNOME [Ubuntu’s desktop] does not provide this option by default. Fortunately, Canonical ships an extension with Ubuntu out-of-the-box, which allows the user to add desktop shortcuts.

To check whether desktop icons are set to show or not, follow the steps given below.

Gnome Tweaks

Open GNOME Tweaks. If you do not have GNOME Tweaks installed, you can install it by running the following command in the terminal:

$ sudo apt install gnome-tweaks

Ubuntu Desktop Tab

On Ubuntu 18.04 LTS, click the Desktop tab. Make sure that the Icons on Desktop option is enabled, as shown below.

On later versions of Ubuntu, the desktop icons setting can be found under the Extensions tab of GNOME Tweaks. If this extension is not installed for some reason, follow the steps in the next section to install it.

Install Ubuntu Gnome Extensions

Launch Firefox or Chrome and browse to this link.

Click here to install the GNOME Shell Integration extension for your browser

Open the Terminal and run the following command:

$ sudo apt install chrome-gnome-shell

Restart the browser and navigate to this link.

Click the toggle button to set it to on, and in the following prompt, click Install

We can now move on to creating the shortcuts. The method varies if the application was installed or just ran from an extracted archive.

Creating Desktop Shortcuts for an Installed Application

In the case of an installed application, follow the given steps to create shortcuts:

Launch the Files app. Press Ctrl+L to make the address bar editable. Copy and paste the following path in the address bar: /usr/share/applications

“/usr/share/applications” contains the .desktop files of all the applications installed on the system. Locate and copy the .desktop file of the desired application. Paste the .desktop file of the application to your desktop. Double click the copied .desktop file

On the prompt, click on Trust and Launch – this will update the icon and its label with the application’s icon and title, and launch the application

Creating Desktop Shortcuts for Tar Archive Application

In the case of an application that was extracted through an archive [such as a .tar.gz file or obtained through a cloned git repository], it will probably not have a .desktop file. In this case, you will first have to create this file manually. To do this, follow these steps:

Open the terminal by using the shortcut Ctrl+Alt+T or search for the terminal by opening the dash.

Type the following command. [Replace ApplicationName with the name of the desired application].

$ gedit ApplicationName.desktop

Copy the following lines in the editor window:

[Desktop Entry]
Name=ApplicationName
Comment=ApplicationDescription
Exec=/path/to/executable
Icon=/path/to/icon.ico
Type=Application

The editor window should look something like this:

  • Declares that this file is a Desktop Entry
  • The name of the application for which you are creating this file [update this accordingly]
  • A brief description of the application [update this accordingly]
  • Path to the executable of the application [update this accordingly]. The full path to the executable should be given if it isn’t specified in the $PATH variable; otherwise, just the name of the application would suffice. To check the list of paths in the $PATH variable, type ‘echo $PATH’ in the terminal
  • Path to the icon of the application [update this accordingly]
  • Path to the icon of the application [update this accordingly]

Now, double click this newly created .desktop file and on the prompt, click on Trust and Launch – this will update the icon and its label with the application’s icon and title and launch the application.

Some Alternatives

Other than creating desktop shortcuts to quickly launch your favorite applications, various other alternatives can be opted for depending on a user’s preference.

Using the Applications Menu

This menu shows all the applications installed in Ubuntu in a vertical grid. To launch an application, find its icon in this menu and click it.

Using the Terminal

Installed applications can be launched directly from the Terminal simply by entering the application’s name in the console.

Pinning applications to the launcher

Most users prefer to have their most-used applications placed on the launcher. To pin applications to the launcher, search for the desired application by searching for it and then launching it. Right-click the icon of the launched application in the dock and select the option ‘Add to favorites’ to lock the application to the launcher.

Using the Run Command

To launch an application using the run command, hit ALT+F2. This opens the Run Command Window. Type the name of the application in the text box and hit enter to launch.

Conclusion

With that being said, we conclude our guide on creating shortcuts on the Ubuntu desktop. Hopefully, you learned how to make desktop shortcuts for applications and .tar archives as well.

Video liên quan

Chủ Đề