8

How do I configure Nautilus to open at my Documents folder instead of my home folder?

I've scoured this site and found answers instructing users to edit the /usr/share/applications/nautilus.desktop file, replacing %U with the path to the desired default directory. I've edited all the variants of nautilus.desktop in the said directory, but none of the edits has an effect. I've checked all the files after editing them to make sure that I saved the edit effectively, and all look good to me.

I've edited every file to read as follows:

Exec=nautilus --new-window /home/judy/Documents

I've also edited the org.gnome.Nautilus.desktop file, just to be sure, with no joy.

I'm running Ubuntu 15.10.

Note: if I enter nautilus /home/judy/Documents from the command line, Nautilus properly opens in the desired directory. Is there a simple way that I can configure an icon in the launcher bar to run this command and have the Nautilus icon that looks like a metal file drawer?

Thanks. I'm pulling my hair out over this one.

  • 1
    Did you try a restart after making these changes? – user364819 Dec 6 '15 at 19:12
  • Also, if you just run nautilus --new-window /home/judy/Documents in Terminal does it work as desired? – user364819 Dec 6 '15 at 19:13
  • To my surprise, the way it used to work doesn' t anymore. WIll remove my answer, will post back if I find out why. – Jacob Vlijm Dec 6 '15 at 20:46
  • Thanks for the advice. I've edited the original nautilus desktop files in /usr/share/applications back to their default state. I've copied the org.gnome.Nautilus.desktop file into my ~/.local/share/applications directory and used gedit to edit its Exec line. I've rebooted. I've run the source ~/.profile command. Sadly, still no joy. When I start nautilus from the launcher bar, it still starts in my home directory instead of in my documents directory. – trinkner Dec 6 '15 at 21:10
  • Here is the contents of the file:[Desktop Entry] Name=Files Comment=Access and organize files Keywords=folder;manager;explore;disk;filesystem; Exec=nautilus --new-window /home/judy/Documents Icon=system-file-manager Terminal=false Type=Application DBusActivatable=true StartupNotify=true Categories=GNOME;GTK;Utility;Core;FileManager; MimeType=inode/directory;application/x-gnome-saved-search; X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=nautilus X-GNOME-Bugzilla-Component=general X-GNOME-Bugzilla-Version=3.14.2 etc... the web site doesn't let me add more chars. – trinkner Dec 6 '15 at 21:13
3

The file that is shown in unity-dash is not anymore /usr/share/applications/nautilus.desktop but /usr/share/applications/org.gnome.Nautilus.desktop.

Changing the Exec= line in the file itself does not have any effect. The problem is an entry DBusActivatable=true that makes the system to run nautilus via dbus. So the Exec= line is being ignored. Maybe it is possible to provide nautilus the desired directory through dbus (/usr/share/dbus-1/services/org.gnome.Nautilus.service) but I am not familiar with that system in detail.
For further information look here: https://wiki.gnome.org/HowDoI/DBusApplicationLaunching

A simple solution for me was to hide the gnome/dbus launcher-icon and make the old one visible again. So add the entry NotShowIn=Unity; to /org.gnome.Nautilus.desktop and comment it out in nautilus.desktop. There you can adjust the Exec= line with the desired directory.

(file: org.gnome.Nautilus.desktop)

[Desktop Entry]
NotShowIn=Unity;     # <--------------------------- add this line !
Name=files
Comment=Access and organize files
Keywords=folder;manager;explore;disk;filesystem;
Exec=nautilus --new-window %U
Icon=system-file-manager
Terminal=false
Type=Application
DBusActivatable=true
StartupNotify=true
Categories=GNOME;GTK;Utility;Core;FileManager;
MimeType=inode/directory;application/x-gnome-saved-search;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=nautilus
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.14.2
X-GNOME-UsesNotifications=true
Actions=Window;
X-Unity-IconBackgroundColor=#af4853
X-Ubuntu-Gettext-Domain=nautilus

#OnlyShowIn=Unity;    # <---------------- comment out this line !

[Desktop Action Window]
Name=Open a New Window
Exec=nautilus --new-window
#OnlyShowIn=Unity;    # <---------------- comment out this line !

(file nautilus.desktop)

[Desktop Entry]
#NotShowIn=Unity;     # <---------------- comment out this line !
Name=files
Comment=Access and organize files
Keywords=folder;manager;explore;disk;filesystem;
Exec=nautilus --new-window /{DESIRED_DIRECTORY}     # <- adjust !
Icon=system-file-manager
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;Core;FileManager;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=nautilus
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.14.2
X-GNOME-UsesNotifications=true
Actions=Window;
X-Unity-IconBackgroundColor=#af4853
X-Ubuntu-Gettext-Domain=nautilus

[Desktop Action Window]
Name=Open a New Window
Exec=nautilus --new-window
  • 2
    @techraf Still no joy after editing the files. I'm confused why there are so many nautilus configuration files. What does each do? My system has usr/share/applications/nautilus.desktop, usr/share/applications/nautilus-home.desktop, and usr/share/applications/nautilus-classic.desktop and usr/share/applications/nautilus-autorun-software.desktop, and usr/share/applications/nautilus-connect-server.desktop and usr/share/applications/nautilus-folder-handler.desktop and usr/share/applications/org.gnome.Nautilus.desktop – trinkner Apr 3 '16 at 21:03
  • @trinkner I do not know for what each file exactly is, but these are different launcher-icons for different uses. nautilus-home.desktop e.g. is used for the home-icon in the launcher (open it and look at the comment). You can also create new icons for specific locations. You only have to copy nautilus.desktop and replace %U with the directory. To find it in the dash you have to make sure that there is no entry NotShowIn=Unity. – L31N Apr 4 '16 at 20:35
  • 1
    I succeeded in getting Nautilus to open to my desired folder by making the edits suggested by @techraf. But after the edits, Nautilus continued to open at the default /home/user directory when launched from a pinned launcher bar icon. To solve this, I renamed EVERY nautilus .desktop file in /usr/share/applications by appending .backup to the file name. I appended .backup to the org.gnome.Nautilus.desktop file name. The one file I did not rename was nautilus.desktop, which I edited as suggested by @techraf. Now the launcher icon correctly opens in my desired folder. – trinkner Apr 5 '16 at 18:44
  • 1
    That didn't work either. I'm on ubuntu 18 LTS. This whole thing has been ridiculous. I've tried 30 different things, but I still can't click on a desktop folder and open it. It's amazing to watch time go on and technology regress into uselessness. I thought opening inode/directories was a solved problem. Maybe I'll wait till the next LTS. – Trevor Hickey Jun 8 '18 at 0:46
1

Trying to make this work for a while now. After a lot of frustration, stumbled on something that worked for me:

  • changed all the "Exec" commands in all the files that start with "nautilus"

    Exec=nautilus-autorun-software /home/user/Desktop

  • deleted all existing "Files" icons from my Desktop and /home/user/.local/share/applications folder (had quiet a few of them due to past tries to solve this issue that did not work)

  • changed 3 lines in /usr/share/applications/org.gnome.Nautilus.desktop:

    Exec=nautilus --new-window /home/user/Desktop DBusActivatable=false ... Exec=nautilus --new-window /home/john/Desktop/repos

Note: the Exec command apear twice in org.gnome.Nautilus.desktop! one time at the very last line. changed both.

  • restarted the computer

  • started files from activities (Activities -> Type here to search... -> "Files") and it worked.

I added the Files icon to favorites (with right click -> add to favorites) and it opens the correct folder every time.

This is my org.gnome.Nautilus.desktop file after the change:

   [Desktop Entry]
   Name=Files
   Comment=Access and organize files
   # Translators: Search terms to find this application. Do NOT translate or 
   localize the semicolons! The list MUST also end with a semicolon!
   Keywords=folder;manager;explore;disk;filesystem;
   Exec=nautilus --new-window /home/user/Desktop
   # Translators: Do NOT translate or transliterate this text (this is an icon 
   file name)!
   Icon=org.gnome.Nautilus
   Terminal=false
   Type=Application
   DBusActivatable=false
   StartupNotify=true
   Categories=GNOME;GTK;Utility;Core;FileManager;
   MimeType=inode/directory;application/x-7z-compressed;application/x-7z- 
   compressed-tar;application/x-bzip;application/x-bzip-compressed-tar;a$
   X-GNOME-UsesNotifications=true
   Actions=new-window;
   X-Unity-IconBackgroundColor=#af4853
   X-Ubuntu-Gettext-Domain=nautilus

   OnlyShowIn=Unity;GNOME;

   [Desktop Action new-window]
   Name=New Window
   Exec=nautilus --new-window /home/user/Desktop/repos

Hope it will help.

-1

There is a simpler way:

  • Create an empty file in your desktop.

  • Open it with a text editor, such as gedit.

  • Write the following lines:

    [Desktop Entry]
    Name="Open Nautilus in custom folder"
    Exec="nautilus /path/to/custom/folder"
    Type=Application
    

Save it as nautilus_custom.desktop. Open a terminal and run:

chmod +x $HOME/Desktop/nautilus_custom.desktop

Without quotes. Now you should be able to start Nautilus in you custom folder by double-clicking the file you've just created in your desktop.

  • Sorry, but this is really bad. Never have multiple .desktop files represent the same application in their main command. It will mess up the presence of nautilus in the launcher. – Jacob Vlijm Dec 6 '15 at 19:56

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.