The default entries, which are added automatically to the Files
launcher icon (not the ones, mentioned in the .desktop file
) , are stored in ~/.config/gtk-3.0/bookmarks
, as lines in the format:
file:///home/[your_username]/Documents
file:///home/[your_username]/Downloads
etc.
I am afraid you will have to re-enter them manually if the file was messed up somehow.
...Or, if you simply want to use all the entries in ~/.config/user-dirs.dirs
, you can use the script below :)
#!/usr/bin/env python3
import os
home = os.getenv("HOME")
exclude = ["Desktop", "Templates"]
with open(home+"/.config/user-dirs.dirs") as locations:
homelinks = [item.replace("\n", "").split("$HOME/")[-1][:-1] \
for item in locations.readlines() if item.startswith("XDG_")]
with open(home+"/.config/gtk-3.0/bookmarks", "wt") as bookmarks:
for item in homelinks:
if not item in exclude:
bookmarks.write("file://"+home+"/"+item+"\n")