I'm running Ubuntu 13.04 with Nautilus 3.6 and I want to edit the Nautilus Places sidebar menu (Not Bookmarks).
By default have the following items: Recent, Home, Desktop, Documents, Downloads, Music, Pictures, Videos & Trash.
I wish:
- Add folder to Places (Not Bookmarks).
- Added Folder must be present in Unity QuickList (Right Click Nautilus icon in Launcher).
- Remove Recent files (Default in Nautilus 3.6).
- Rename Trash to another name.
how can I achieve these goals?
NOTE: I tried editing ~/.config/user-dirs.dirs
file, but not luck. Is there another way to customize Nautilus Places menu?
Best Answer
In order to achieve that.. you should edit the Nautilus source code and the
nautilus.desktop
file or using another file manager that allows this, such as nemo.NOTE: In this example I'm running ubuntu 13.04 with nautilus (files) 3.6.3.
You can test this in a virtual machine to see if everything is OK.
1) Make sure you have enable the Source code repository
Open a Terminal Window to update the repositories.
sudo apt-get update
2) In the Terminal type the following to install the necessary packages.
sudo apt-get install build-essential quilt
3) Install build dependencies.
sudo apt-get build-dep nautilus
4) Create a folder to download the source code.
mkdir ~/Downloads/src
cd ~/Downloads/src
5) Download the source code & Export variables.
apt-get source nautilus
export QUILT_PATCHES=debian/patches
export EDITOR=gedit
6) Create the patch and edit the source code.
cd nautilus-3.6.3/
quilt new my_custom_places.patch
quilt edit src/nautilus-places-sidebar.c
Custom Trash: To change the name of the Trash.You can change the strings in the lines 567 and 569.
eg: "Trash" to "Custom Trash" & "Open the trash" to "Open the Custom Trash"
Add Folder: In this example I will add the "Test" folder in my home directory /home/virtual/Test. (change the folder according to your needs)
After the line number 562 add the following:
Remove Recent Files: To remove the Recent Files from the places... delete the lines from 525 to 534.
Save the changes.
7) Build the deb packages.
quilt refresh
fakeroot dpkg-buildpackage
8) Install the deb packages.
cd ..
sudo dpkg -i *deb
9) For system-wide..edit the nautilus.desktop file to add the folder eg:(/home/virtual/Test) in the quick list.
sudo nano /usr/share/applications/nautilus.desktop
Change:
To:
Add:
Before:
After:
10) Finally you can logout and Login to see the changes.
RESULT:
Hope this helps.