Ubuntu – How to pin the favorite folders in Ubuntu dock like in Windows

gnome-shellubuntu-dock

I miss those pins I make in Windows.

enter image description here
enter image description here

How can I do the same in Ubuntu 17.10 with GNOME 3?

Best Answer

Follow the steps below.

  1. Create a .desktop file (say custom-filemanager.desktop) in ~/.local/share/applications. You can do this by running the following command in Terminal

    touch ~/.local/share/applications/custom-filemanager.desktop
    
  2. Open the .desktop file using a text-editor, for example by running

    gedit ~/.local/share/applications/custom-filemanager.desktop
    
  3. Add the following lines to the file:

    [Desktop Entry]
    Name=File Manager
    Comment=Access and organize files
    Keywords=folder;manager;explore;disk;filesystem;
    Exec=nautilus --new-window %U
    Icon=org.gnome.Nautilus
    Terminal=false
    Type=Application
    Categories=GNOME;GTK;Utility;Core;FileManager;
    Actions=new-window;open-downloads;
    
    [Desktop Action new-window]
    Name=New Window
    Exec=nautilus --new-window
    [Desktop Action open-downloads]
    Name=Open my Downloads folder
    Exec=nautilus /home/YOUR-USER-NAME/Downloads
    

    Replace YOUR-USER-NAME by your user-name in the last line.

  4. Save the file.

  5. Click on "Activities" and search for "File Manager". It should appear.

  6. Right click on the "File Manager" and select "Add to Favourites". It should be added to the dock.

Now if you right click on the newly added File Manager icon in the dock, you should see a "Open my Downloads folder" option which should work as expected.

enter image description here

Similarly you can add shortcuts to other locations by adding new Desktop Actions and adding the name of the action to the Actions= line. For more info see this.