Ubuntu – How to add folder shortcuts to the Launcher

desktoplauncherquicklists

I want to add some folder to the launcher so that I can access them at ease. How do I add shortcut to launcher?

Best Answer

There are two ways:

Dynamically

You can add a shortcut to a folder by browsing (in nautilus) into the folder you want to add, and choose "add bookmark" from the bookmark menu. Alternatively, you can press Ctrl+D. Bookmarks you created this way are added automatically to the Files icon in the launcher, in the top section (Nautilus adds these shortcuts to the file: ~/.config/gtk-3.0/bookmarks).

In the "static" section of the launcher's icon.

Alternatively, you can add a shortcut to the Files icon (or any other icon), by editing its .desktop file. This method gives you more control over the name of the shortcut, and the order of shortcuts, if you have more than one.

  • To do that, first copy the .desktop file to ~/.local/share/applications

    cp /usr/share/applications/nautilus.desktop  ~/.local/share/applications/nautilus.desktop
    
  • Open the (copied) file with gedit; it won't open by double-click, so open a gedit window and drag the file over the gedit window.

  • Look for the line:

    Actions=Window;
    

    Add a name that you would like to give your folder in the launcher:

    Actions=Window;YourFolder;
    
  • At the end of the file, add a section like this:

    [Desktop Action YourFolder]
    Name=YourFolder
    Exec=nautilus /path/to/thefolder
    OnlyShowIn=Unity;
    

Log out and back in, now you'll have your shortcut in the Files icon by right-click.

Explanation:

Icons in Dash and the launcher represent .desktop files. These icons have one "main" command (that's what happens if you click on it), but also can have a number of shortcuts (accessible by right-click).

This "main" command can be found in the Exec= line, in the section directly below [Desktop Entry], the shortcuts are listed in the line Actions=, and defined in the [Desktop Action YourFolder] - section(s).

.desktop files in ~/.local/share/applications overrule the ones in /usr/share/applications, but the first time after you copy the original to the local directory, you have to log out/in. The clean procedure is always to edit the local one and leave the original untouched.

Note:

Bookmarks that you created by the first method, are added to the icon automatically, but are not part of the nautilus.desktop file.


Edit for 15.04 and later

The answer above applies for 15.04 and above as well, but the launcher to edit (locally copied) for the static section is:

/usr/share/applications/org.gnome.Nautilus.desktop

instead of

/usr/share/applications/nautilus.desktop