Change file managers (Nautilus) sidebar

Just found a way to change the folders in the file managers sidebar.
Maybe this is useful for others, so I'll share it here.

Open the terminal and edit these files:

  • $ sudo gedit ~/.config/user-dirs.dirs
  • $ sudo gedit /etc/xdg/user-dirs.defaults
    To remove folders, comment them out with the # symbol, you can also add files to the list.

~/.config/user-dirs.dirs changes the sidebar folder for the current session, but on boot it gets rebuild from /etc/xdg/user-dirs.defaults, that's why you have to edit both.

I did not yet find a way to choose the order of the folders in the sidebar, I anyone know how to do this, please let me know.

10 Likes

Thanks, this is helpful. To see the change, I had to reload the Gnome desktop (Alt-F2 and then r). I did notice that it moves the commented out folder to your "bookmarks" which you can then remove.

Edit:
I found that this did not persist after a reboot. Thoughts on how to make it "stick"?

2 Likes

Yeah, that sucks!
Did not yet found a solution.

We could maybe write a startup script to change the file?

Odd... this persists after reboot for me.

1 Like

That's strange!

I found the solution!

~/.config/user-dirs.dirs is rebuilt on login from /etc/xdg/user-dirs.defaults.
So you have to edit both directories for it to persist after reboot.

I've changed my initial post.

Found the solution here: 16.04 - How to remove unwanted default bookmarks in Nautilus? - Ask Ubuntu

2 Likes

Thanks, that is super useful for me!

2 Likes

I facepalmed... I am sorry Hanne, I have been busy with a lot of other things... That is where my edits are made. I should have remembered that and mentioned it earlier... It really did not occur to me. My only excuse is that I blame my brain.

2 Likes

Haha, no worries!
It's fun to find the solution yourself :smiley:

1 Like