19

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?

  • 5
    Most unfortunate that this simplest and needy requirement isn't available out-of-the-box! – George Udosen May 6 at 13:59
  • Cannot agree more @GeorgeUdosen ! – Psychotechnopath May 6 at 14:29
  • @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 at 8:47
10

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.

| improve this answer | |
  • 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 – TheBuntuNewb Apr 28 at 22:18
  • 2
    When I try this it simply opens the .desktop file, not the actual application – Psychotechnopath Apr 29 at 14:33
  • Right click the file and press allow launching – TheBuntuNewb Apr 29 at 17:57
  • Yes, I’m running it on my main machine and in a vm – TheBuntuNewb Apr 29 at 17:58
  • 1
    Yes I tried it on 20.04 – TheBuntuNewb Apr 29 at 17:59
6

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/
    
| improve this answer | |
  • 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 at 3:55
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)

| improve this answer | |
  • 3
    Unfortunately this does not work on Ubuntu 20.04 – Psychotechnopath May 1 at 19:56
3

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

| improve this answer | |
  • 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 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 at 7:34
3

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...

| improve this answer | |
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.

| improve this answer | |
-4

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.

| improve this answer | |
  • 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? – Psychotechnopath Apr 29 at 14:34
  • 7
    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 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) – HattinGokbori87 May 3 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. – HattinGokbori87 May 3 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.