Ubuntu 14.04: Add links to places in menu
Solution 1
There are a number of ways to add a link to places. It's called bookmark. While in the directory that you want added click on the bookmark menu and mark it as a book mark.
Solution 2
Sorry for bringing up an old question, but the accepted answer explains how to add items to Bookmarks, not Places. Sadly, you can't add to the Places list.
The items in Places are defined in .config/user-dirs.dirs
. Mine looks like this:
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
You can freely add more directories but they are not listed in Nautilus. You can change the folders to point to different directories or you can set them to "$HOME/" to remove them (see man xdg-user-dirs-update
) but you are not able to add to them. That's because the xdg tools (eg xdg-user-dir
) have a fixed list of "Places" directories that can be set. You can see this list with man xdg-user-dir
:
This command expects the name of an XDG user dir as argument. The
possible names are:
DESKTOP
DOWNLOAD
TEMPLATES
PUBLICSHARE
DOCUMENTS
MUSIC
PICTURES
VIDEOS
Sorry, but you are not able to add new entries to the Places menu and have it recognized by the xdg-* tools. Bookmarks are changeable. Depending on the version and flavor of Linux you can find a menu item to add/edit bookmarks, press Ctrl-D, or press on a gear symbol to add a location as a bookmark. Your bookmarks are stored in .config/gtk-3.0/bookmarks
. It appears that duplicate entries (ones in both Bookmarks and Places) only show up in Places, at least in Nautilus.
Solution 3
you can add your own item by modify the user-dirs.dirs file just create a folder in home directory then add your location to the file like following
cd .config
sudo nano user-dirs.dirs
i add programs to the list
XDG_DOCUMENTS_DIR="$HOME/programs"
you can change the icon by mofdi the XDG_{icon name}_DIR
then just reopen the file manager and that's it
my final file is
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
XDG_DOCUMENTS_DIR="$HOME/programs"
Solution 4
The xdg-user-dirs-update
command seems to be the perfect solution!
xdg-user-dirs-update --set PICTURES $HOME/some_random_dir/
From man xdg-user-dirs-update
:
--set NAME PATH
Sets the XDG user dir with the given name.
NAME should be one of the following:
DESKTOP
DOWNLOAD
TEMPLATES
PUBLICSHARE
DOCUMENTS
MUSIC
PICTURES
VIDEOS
PATH must be an absolute path, e.g. $HOME/Some/Directory.
Related videos on Youtube
PeterHeuz
Updated on September 18, 2022Comments
-
PeterHeuz over 1 year
I would like to add custom links to the places window on the top of the left pane in every nautilus window. I found solutions that suggest to just drag and drop it over the left pane, but that does not work with my Ubuntu 14.04.
Does anybody know how it works here?
-
Johu over 9 years
Bookmarks
andplaces
are not the same thing. They appear different on the left side menu inFiles
. See this thread for example. -
Emile Bergeron about 9 yearsI didn't know about bookmark and while searching for a way to add links to places, what I really wanted was bookmarks and this answers me very well.
-
TungstenX over 8 yearsCtrl D worked for me to put start the Bookmark section and put the directory in it (Nautilus). I would like to edit the Places section, seeing that it is my laptop :s
-
WillC almost 7 yearsThis lets you change one of the existing fixed list to your custom location, but doesn't let you add to the list; xdg-user-dirs-update won't let me have 'Downloads_Data' and 'Downloads_Executables', for example. Still good to know though.
-
WillC almost 7 yearsOn mine - 14.04 - after closing and re-opening Nautilus that removed the 'Documents' entry in the Places list and replaced it with one named 'programs'. Adding another line to XDG_DOCUMENTS_DIR="$HOME/programs2" then replaced the 'programs' entry with 'programs2'. So it looks like it'll use the last part of the filepath as the display name in the list, but only let you have one per the fixed set of entries (see fedorqui answer for that set).