How to create a shortcut in Ubuntu

Since the time Windows we are accustomed to desktop shortcuts. It is beautiful, practical and very comfortable. But in recent versions the developers at Canonical decided that users should use the side panel, and the desktop space. But not all users satisfied with the status quo.

In this article we will discuss how to create a shortcut on the desktop of ubuntu, and will understand how to create a shortcut for the program.

To add a shortcut in Ubuntu

Adding a shortcut to Ubuntu on the side panel will not cause any difficulties even for novice users. Just drag the application icon from the Dash menu in the pane:

You can also click the right mouse button on the desired app in the menu and choose add to favorites:

After that a shortcut will appear on the panel. With the desktop the situation is more difficult. When you try to copy an application error occurs. But despite the wishes of the developers from Canonical, as they say, if you really want you can. First, install gnone-tweak-tool command:

sudo apt-get install gnome-tweak-tool

Run the app and on the desktop tab, select Show desktop icons to a position On:

Then open in file Manager Nautilus /usr/share/applications and copy the shortcut of the desired program on the desktop. Please note you need to copy it using the context menu, not by drag and drop:

After you insert the label, it will be determined as an unknown file. Run it and the system will ask if you trust the label. Once you click to Trust and runthe file turn into a normal application shortcut.

If your program shortcut does not exist, you can create it manually. The names of the shortcut files end with the extension .desktop and have the following syntax:

[Desktop Entry]
Version=1.0
Name=name
Comment=description
Exec=/path/to/executable/file
Icon=/path/to/icon
Terminal=false
Type=Application
Categories=categories

Here is the most important parameter is the Exec. It needs to contain the full path to the executable program file in the file system. You also need to specify the full path to the icon and the name. For example, a shortcut to start a particular virtual machine in VirtualBox will look like this:

vi ubuntu18.04.desktop

[Desktop Entry]
Version=1.0
Name=18.04 Ubuntu VM
Comment=Start the VM Ubuntu 18.04
Exec=/usr/bin/VBoxManage startvm "Ubuntu1804"
Icon=/usr/share/icons/hicolor/256x256/apps/ubuntu-logo-icon.png
Terminal=false
Type=Application

This file can be saved. Click right mouse button and go to tab Rights. Here you need to tick Allow running file as a program:

Then run the shortcut and agree that he can be trusted:

Thus, you can execute any command or run any program with the right options.

If you don’t want to edit the file manually, you can use utility gnome-desktop-item-edit. To install it run:

sudo apt install --no-install-recommends gnome-panel

Then, to create a shortcut Ubuntu we need to perform:

gnome-desktop-item-edit ~/work table/ --create-new

Here you need to enter a shortcut name, command and description. Then click OK to add a shortcut. You need to activate it in the same way as manually created.

Insights

Now add a shortcut in Ubuntu 18.04 not a problem for you, even despite the fact that the developers hid this possibility. Linux was and still is the system where everything can be customized. Good luck with your experiments!

Source: losst.ru

(Visited 30 times, 1 visits today)