Ubuntu – Is it possible to create a folder shortcut in Kubuntu

kubuntushortcuts

I know how to create a symbolic link to a folder. However, when you access the target folder (e.g. from a symbolic link on the Desktop), it appears as if the target folder is a child of the Desktop folder. I'd like it to work as in Windows where you actually get to the folder and can see it in its real context.

I've come across similar questions, one of which suggests creating a launcher. I believe this is meant for GNOME/Unity Ubuntu and I'm not sure what the equivalent on KDE would be.

How can I achieve this on Kubuntu 19.10 with KDE Plasma?

Best Answer

  • Suppose you want a link in ~/Desktop/ to this folder:

    ~/Documents/my-project/
    

    You can do this with dolphin like so:

    • Navigate Dolphin to ~/Desktop.

    • Right-click → "Create New" → "Link to Location (URL)..."

      Right-click menu

    • In the "File name" field, enter "my-project.desktop"

      Dolphin - Create link to URL

    • In the "Enter link to location (URL)" field, click the folder icon ("Open file dialog") and navigate to ~/Documents/my-project, then click "Open".

      Fields filled in.

    • Click "OK".

    This will create a link to the folder on the desktop that looks like this:

    my-project.desktop

    Double-clicking it will open Dolphin to this path:

    ~/Documents/my-project/
    

    You can also move this desktop file to any other directory and it will work just the same.

    The contents of the text file are:

    [Desktop Entry]
    Icon=folder
    Type=Link
    URL[$e]=file:$HOME/Documents/my-project/
    

    This is an example of a Link-type desktop file, which is part of a FreeDesktop standard. If you want to ensure it works the same on other desktops, open it in a text editor and add a Name field and change the URL field to a standard file:// URL:

    [Desktop Entry]
    Name=my-project
    Icon=folder
    Type=Link
    URL=file:///home/my-user-name/Documents/my-project/
    
  • Related Question