39

Let's add some fresh knowledge to the forum now Ubuntu 20.04 is out =). My question today is simple; what is the most elegant way to create desktop shortcuts (e.g. to folders, applications or documents) in Ubuntu 20.04?

3
  • 11
    Most unfortunate that this simplest and needy requirement isn't available out-of-the-box! May 6, 2020 at 13:59
  • @GeorgeUdosen From the top answers it doesn't look much different from the way it used to work in older releases though (for example: askubuntu.com/a/457377/480481).
    – pomsky
    May 7, 2020 at 8:47
  • 1
    NONE of the suggested solutions worked for me. It is absolutely crazy that in 2021 you cant add a link to a launch bar. I ended up creating a link using ln command, but that still wouldn't allow me to add my app to the launch bar
    – Rotkiv
    Jan 13, 2021 at 16:48

14 Answers 14

26

For Application Shortcuts:

I think TheBuntuNewb's answer is pretty good. Do that using file manager:

  1. Open /usr/share/applications
  2. Copy the application shortcut to desktop
  3. Right click on the shortcut on the desktop and select Allow Launching

For Folder/File shortcuts:

Either directly use the terminal to create a symbolic link

ln -s <complete path to dir> <shortcut save location>

or

  1. Open the folder in the file manager (nautilus), navigate to the directory to which you want to create a shortcut to.

  2. Right click and select Open in Terminal.

  3. For shortcut to current directory, type and execute

    ln -s $PWD ~/Desktop/
    

    For shortcut to a file/folder inside the current directory, type and execute

    ln -s $PWD/filename ~/Desktop/
    

    or

    ln -s $PWD/dirname ~/Desktop/
    
4
  • I will suggest to use "$PWD" , as if you have spaces in folder paths, this will not create correctly. Thanks for this.
    – Erdnase
    Sep 8, 2020 at 3:55
  • @Erdnase and here I thought only Windows has this nonsense
    – Gulzar
    Apr 4, 2021 at 14:24
  • This should be the accepted answer because it actually allows to create a desktop shortcut, rather than suggesting you to reuse a shortcut which can only exist for only certain installed applications...
    – Arturas M
    Apr 6, 2021 at 14:08
  • Its works for me linuxconfig.org/… Apr 29, 2021 at 2:04
19

You can copy a file from /usr/share/applications to your desktop folder (~/Desktop) using the cp command. Then right click the .desktop file and select 'allow launching'.

An example would be

cp /usr/share/applications/nautilus.desktop ~/Desktop

Make sure to include the .desktop ending.


You might also have to allow launching for an existing .desktop file after upgrading to Ubuntu 20.04.

12
  • Yes I was able to launch the file but the icon looks like a cog, but you can change that by right clicking the fille, choosing properties, click the icon and select the proper one
    – Twilight
    Apr 28, 2020 at 22:18
  • 5
    When I try this it simply opens the .desktop file, not the actual application Apr 29, 2020 at 14:33
  • Right click the file and press allow launching
    – Twilight
    Apr 29, 2020 at 17:57
  • Yes, I’m running it on my main machine and in a vm
    – Twilight
    Apr 29, 2020 at 17:58
  • 1
    Yes I tried it on 20.04
    – Twilight
    Apr 29, 2020 at 17:59
11

Easy graphical way:

  1. show your desktop in your home directory

1.1. enable symbolic links in nautilus: Settings → Behavior → [x] Show action to create symbolic links

  1. open two windows of nautilus. one for the desktop, second for the shortcut you want to produce.

  2. click the item the shortcut has to produced for with the left mouse button and drag it to the desktop folder in your home directory with the ALT-key pressed.

  3. when you leave the item on the desktop folder a context meune appears, that give you three options. One of them is "create symbolic link" or so.

Then you're done.

Its awful, that this simple feature has to be done the complex way...

4

On default DE (Gnome 3) symlinking does not work, but .desktop files copying works as TheBuntuNewb said: enter image description here enter image description here enter image description here

For Lubuntu 20.04 desktop the next works:

Displaying items on the desktop could be done using .desktop file copying, .desktop file or folder symlinking or .desktop file creating.

user@ubuntu:~$ ls -ailh ~/Desktop/
total 32K
8126477 drwxrwxr-x  2 user user 4,0K тра  1 12:58 .
8126465 drwxr-xr-x 21 user user 4,0K тра  1 11:49 ..
8130587 -rwxr-xr-x  1 user user  239 кві 20 17:38 anydesk.desktop
8126512 -rw-rw-r--  1 user user   90 тра  1 12:48 computer.desktop
8130987 lrwxrwxrwx  1 user user   22 тра  1 12:58 Documents -> /home/user/Documents
8130976 -rw-rw-r--  1 user user   97 тра  1 12:51 Downloads.desktop
8129570 lrwxrwxrwx  1 user user   45 тра  1 12:30 google-chrome.desktop -> /usr/share/applications/google-chrome.desktop
8126514 -rw-rw-r--  1 user user   94 тра  1 12:48 network.desktop
8129813 -rw-rw-r--  1 user user  102 тра  1 12:58 trash-can.desktop
8126513 -rw-rw-r--  1 user user   89 тра  1 12:48 user-home.desktop
  • anydesk.desktop file is copied: `cp /usr/share/applications/anydesk.desktop ~/Desktop/
  • google-chrome.desktop is symlinked using ln -s /usr/share/applications/google-chrome.desktop /home/user/Desktop/
  • Documents link is created by: ln -st /home/user/Desktop /home/user/Documents
  • Downloads.desktop file which opens the Downloads directory by nautilus is created the next way:

    [Desktop Entry]
    Type=Application
    Exec=nautilus /home/user/Downloads
    Icon=folder
    Name=Downloads
    

In my case file properties changing is not required for .desktop file - it asks to execute it anyway:

enter image description here enter image description here

2
  • 1
    The second part of your answer is not related to Unity, but GNOME 3 (default DE on standard Ubuntu 20.04).
    – pomsky
    May 1, 2020 at 19:55
  • The following website illustrates the same, but it was a bit easier to follow for me than this one. linuxconfig.org/…
    – Prof.Chaos
    Oct 12, 2020 at 7:34
4

In ubuntu 20.04 you need to make the file executable first, then you'll find the "allow launching" option, anyway I can't add it to the launcher, there's simply no way to do it.

[Desktop Entry]
Version=1.0
Name=blender
Type=Application
Exec=/home/ego/blender-2.93.0-9b87d3f02962-linux64/blender
TryExec=/home/ego/blender-2.93.0-9b87d3f02962-linux64/blender
Terminal=false
StartupNotify=true

It's ridiculous that there's no easy way to do this. You need to search google and become crazy simply to add one icon. One icon. Great OS.

1
  • 1
    I share your frustration. Even more annoyingly, they actually removed this feature, e.g. 10.04 had it. To add to launcher copy to ~/.local/share/applications as well as ~/Desktop Aug 21, 2021 at 22:54
3
+25

A very easy and elegant way to create a shortcut to an file or folder is to create a symlink to the desktop. I have tested this on Lubuntu 20.04 LTS

To do this do the following:

  1. Drag the file or folder from pcmanfm to your desktop enter image description here

  2. Then choose create symlink here

  3. Finally a shortcut should have been created! enter image description here

As I said before, this will probably only work on Lubuntu 20.04 (featuring the LXQt desktop)

1
  • 4
    Unfortunately this does not work on Ubuntu 20.04 May 1, 2020 at 19:56
3

I'm very new to linux, but you all made this too difficult for 20.04. You were close to making it simple. Easy solution!

Click on Files or Show Applications and type Files, and open Files. Now in the upper right corner you have your 3 lines hamburger menu. Click that, and click Preferences, then click Behavior, then "Show Action to create symbolic links".

Now any time you right click on a file or folder, you can drag that file or folder with in "Files" to "Desktop" on the left side column. Once the symbolic link or shortcut is moved, you can rename it so it looks like the original source file or folder name.

3

This answer was meant to be a comment, but I don't have enough reputation points.

A small addition on TheBuntuNewb's answer that might be obvious to some but nearly drove me crazy: the name of the .desktop file has to match exactly the name of the executable file.

For example, I was trying to create a shortcut for pycharm named pycharm.desktop, but the Allow launch option was not showing up, until I renamed the file to pycharm.sh.desktop. After renaming everything worked smoothly.

I am assuming this is due to security concerns, but it's worth pointing out to hopefully save someone's time!

2

Why not just use gnome-extensions?

Installation:

Usage:

enter image description here

enter image description here

1
  • Works perfectly, Amazing! Works also for appImage, but for this one, the key was to find out where the .desktop file is hided... For me, it was at ~\.local\share\applications (after using the AppImageLauncher)
    – hamagust
    Mar 3, 2021 at 20:48
2

Thanx to "nobody" here on this forum, the command below solves this problem once you've created your starter on your desktop:

~ gio set /location_of_the_starter/name_of_the_starter metadata::trusted yes #true for Ubuntu

My exemple on Debian:

me@debian:~ gio set /home/me/mystarter.desktop metadata::trusted yes

My exemple on Ubuntu:

me@ubuntu:~ gio set /home/me/mystarter.desktop metadata::trusted true

Hope this helps.

1

The easiest UI way:

Just open two windows of Files (file manager) and drag a file what you need, with holding down Alt key, as result you will get a familiar window dialog with Link Here

You can't create link directly dragging file to Desktop, you should open Desktop via Files

Tested on Ubuntu 20.04

0

For folder shortcut, first you need to enable the simlink creation under Files --> Preferences in the Behavior tab (Show action to create symbolic links) in order that the Create link menu can appear when you right click on a folder. You can do the same with SHIFT+CTRL+M but this key combination works only if the simlink creation is enabled as described above (otherwise useless), and you will also need to turn on Capslock before using the keys to trigger capital 'M'...

For an average desktop user this is pain, and could be all enabled as default.

0

The start of Eiko's "Easy graphical way:" (see above) had the best answer. Do as far as Eiko's 1.1 (viz. again to quote in part Eiko's method

1 show your desktop in your home directory

1.1. enable symbolic links in nautilus: Settings → Behavior → [x] Show action to create symbolic links

but then after 1.1 follow with

move to the the file or folder to be linked and right-click upon it to open a drop-down/pop-up menu then use the Create Link option (or use Shift+Ctrl+M hot-key. This creates the link in the target's directory which can be copied/moved to the required location.

I had also discover, without Eiko's first steps that simply doing a shift-control while drag-and-drop on the target object but with dragging just off the target's position followed by dropping back onto the target correctly creates the iconised link locally in the target's directory.

The behaviour is different (changed?) to how it was in past versions.

-3

To keep working with GUI one have to enable symbolic link creation in Nautilus by visiting its settings: Settings → Behavior → [x] Show action to create symbolic links and then user will be able to create symbolic links for executables, folders and files on the ~/Desktop.

But the most elegant way for average non-techinal user who is scared by the terminal - would be to not use GNOME Shell and install Unity or MATE DE instead with one of the two solutions below:

  • sudo apt-get install ubuntu-unity-desktop

  • sudo apt-get install ubuntu-mate-desktop^

then select one of these sessions on the login screen and as the result to forget this new GNOME Shell nightmare (the Desktop without DESKTOP is a pain, but not the real desktop).

More technical users who prefer traditional desktop with traditional habbits have to remove GNOME Shell completely and install other DE of their preference. I have a solution for such method which was tested on Ubuntu 20.04 LTS freshly installed VM.

4
  • Could you elaborate ~ What is GNOME Shell, what is Unity / MATE DE, and what do you mean by your last sentence? ("he Desktop without DESKTOP is a pain, but not the real desktop"). Is it necessary to install a new desktop to create shortcuts? Apr 29, 2020 at 14:34
  • 8
    Being sarcastic, in 2020 it is necessary to install new/other desktop to get the functionality which were here for 25+ years. The desktop is a desk top, so you can add icons and folders here like if the are physical objects. For now it is difficult to do in the enterprise-grade default Ubuntu desktop environment. The GNOME Shell, Unity and MATE DE are desktop environments. Use Google, YouTube or any other means to get brief vision of their look and feel. The functionality loss of GNOME Shell you have already discovered.
    – N0rbert
    Apr 29, 2020 at 14:48
  • 3
    1/2:- I can create shortcut of anything on desktop using right-click menu on Xfce (Xubuntu). As far I know GNOME devs removed the functionality several versions back. They want the desktop to be a plain wallpaper with nothing on top. They also want app windows to be minimized-maximized exclusively with mouse gesture. Ubuntu is using various workaround to get around these "features" including extensions which is already irritating some people (bit.ly/35txvCb) May 3, 2020 at 0:49
  • 3
    2/2:- Recently there's some cries like that about how extensions are de-virginizing gnome. So we shouldn't be surprised to see that feature being limited/ terminated in the future too. May 3, 2020 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.