How to drag a folder to the launcher from Nautilus

How can I add a folder to the launcher for quick access to it. In this particular case I wish to drag it to the launcher.


  1. First create a desktop configuration file: gedit ~/.local/share/applications/folder-shortcut.desktop
  2. Copy and paste the following content to launch nautilus (the file explorer) with the specified folder

    [Desktop Entry]
    Name=Home Folder
    Comment=Open YOURFOLDER
    Exec=nautilus YOURFOLDER
    Icon=folder
    Terminal=false
    StartupNotify=true
    Type=Application
    OnlyShowIn=GNOME;Unity;
    Categories=GNOME;GTK;Core;
    X-GNOME-Bugzilla-Bugzilla=GNOME
    X-GNOME-Bugzilla-Product=nautilus
    X-GNOME-Bugzilla-Component=general
    X-GNOME-Bugzilla-Version=3.0.0
    X-Ubuntu-Gettext-Domain=nautilus
    Actions=Window;
    NoDisplay=true
    
    [Desktop Action Window]
    Name=Open YOURFOLDER
    Exec=nautilus YOURFOLDER
    OnlyShowIn=Unity;
    

    Replace "YOURFOLDER" with the path to your folder

  3. Now navigate to this file graphically from nautilus and drag it to your launcher


I'm not sure if it's possible to drag and drop a folder onto your unity bar - but you can have the same functionality with a bit of editing.

  • Edit Nautilus .desktop file
    1) In a terminal (Ctrl+ALT+T) type: gedit ~/.local/share/applications/nautilus-home.desktop
    2) If this already exists, edit the following line to add your NEWFOLDER shortcut:

    X-Ayatana-Desktop-Shortcuts=Videos;Documents;Music;Pictures;Downloads;Dropbox;NEWFOLDER  
    

    3) Below X-Ayatana-Desktop-Shortcuts add a new shortcut group:

    X-Ayatana-Desktop-Shortcuts=Videos;Documents;Music;Pictures;Downloads;Dropbox;NEWFOLDER
    [NEWFOLDER Shortcut Group]
    Name=New Folder
    Exec=nautilus ~/Documents/newfolder
    TargetEnvironment=Unity
    

    Where ~/Documents/newfolder is the location of the shortcut you want to add.
    (N.B. if this file doesn't already exist you can use a copy of mine.)
    4) Type into Run prompt (ALT+F2): unity --replace

Now when you right click your home folder/nautilus shortcut you will see an extra option for new folder.

  • Create a new .desktop file for your folder shortcut.
    1) Run gedit again: gedit ~/.local/share/applications/folder-shortcut.desktop
    2) Fill in the file with a sample as follows:

    [Desktop Entry]  
    Exec=nautilus Documents/newfolder  
    Version=1.0  
    Name=New Folder  
    GenericName=ew Folder 
    X-GNOME-FullName=ew Folder 
    Comment=Open New Folder
    Icon=/usr/share/pixmaps/gnome-computer.png  
    StartupNotify=true  
    Terminal=false  
    Type=Shortcut  
    

    2) Save the file and open the location in nautilus.
    3) Drag it onto the unity bar.
    4) Right click the new icon and click Keep in Launcher

N.B. you do not need to refresh unity for this one.