8

I accidentally deleted my Documents folder and didn't notice it for a couple days. Somewhere in that time, Nautilus auto-updated my list of Places so it no longer includes my Documents folder. I have since restored my Documents folder, but the Places link is still missing. How do I get it back?

Jeremy
  • 523
  • 1
    see also http://askubuntu.com/questions/512565/how-to-reset-nautilus-launcher-icon-shortcuts-to-default/512596#512596 – Jacob Vlijm Feb 03 '15 at 14:59
  • Can you verify that your ~/.config/user-dirs.dirs contains the following: XDG_DOCUMENTS_DIR="$HOME/Documents" – Fabby Feb 04 '15 at 10:42
  • That file doesn't exist. I'm this close to searching through the Nautilus source code to find where it gets the Places from... – Jeremy Feb 05 '15 at 05:28
  • Have you looked at http://askubuntu.com/questions/325518/how-can-i-edit-nautilus-places-sidebar-and-unity-quicklist? – Mitch Feb 08 '15 at 09:13
  • Mitch, I hadn't seen that, thanks for the link. I'm not sure if it applies, though. I don't want to add a new folder to the Places menu, I just want to restore what was originally there. If Nautilus can somehow remove deleted folders from the Places menu without recompiling, I should be able to add them back without recompiling, right? – Jeremy Feb 08 '15 at 15:14
  • This might be the straightforward answer you've been looking for: https://unix.stackexchange.com/a/606950/19643 – Stéphane Gourichon Aug 29 '20 at 14:29

2 Answers2

21

Once you have recreated the Documents folder, make sure your ~/.config/user-dirs.dirs contains something like this:

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

You can edit it as needed using any text editor, for example

nano ~/.config/user-dirs.dirs

Then run the command xdg-user-dirs-gtk-update.

Zanna
  • 70,465
aguslr
  • 1,796
3

On Ubuntu 14.04 running gnome-3.10 I was able to restore it by inserting/editing the following file:

~/.config/gtk-3.0/bookmarks

file:///home/%yourusername%/Documents
file:///home/%yourusername%/Music
file:///home/%yourusername%/Pictures
file:///home/%yourusername%/Videos
file:///home/%yourusername%/Downloads

Hope it works for you as well!