I use an external hard drive for my videos and pictures. I've used Ubuntu Tweak to change the path of those two default folders to the folders on my external HDD. Getting to this point is no problem (see image below). However, it stops working after I either restart my laptop or unplug my hard drive as the folders disappear from the Nautilus places list. Is there any way to fix this and set the default paths permanently?
(Ubuntu 12.10 / Nautilus 3.4.2)
I've solved this by making an executable script which I added to my startup applications.
The first thing we should know is that the file with your default folders is
~/.config/user-dirs.dirs
, which is where you can indicate the directories of the folders you want to have listed under "Computer" in Nautilus.Step 1
Create the correct user-dirs.dirs file with all your desired default folders and their locations. I only had to edit two entries so I opened the original (in Terminal:
gedit ~/.config/user-dirs.dirs
), edited it to the correct folders and "saved as" in another location (namely~/Documents/Miscellaneous/
).Step 2
Open up your preferred text editor, like gedit. First we want to remove the original and incorrect user-dirs.dirs file:
rm ~/.config/user-dirs.dirs
. Then, we want to take the correct file we created and copy it into the ~/.config folder:cp ~/FolderWithCorrectFile/user-dirs.dirs ~/.config/
. Make sure to add&&
between the two. In my case it came out like this:rm ~/.config/user-dirs.dirs && cp ~/Documents/Miscellaneous/user-dirs.dirs ~/.config/
I saved this file in the same folder as the correct user-dirs.dirs file, but you can put it anywhere.
Step 3
Now we have to allow the file we just created to be executed as a program. The easiest way to do this is to right click on the file, go to its properties → permissions. There, check the execute tick box. Then run the file to check if it works by verifying the original user-dirs.dirs file has been replaced by your new, correct version.
Step 4
If everything worked, go to "Startup Applications". Browse and add the file we created. Next time you boot your computer all your default folders will be there.
On external harddisk right click on folder where picture is stored and press make link. Now you can see a new folder link. Cut that link and paste it on the home directory. Next rename it to Pictures (use same name as original. Before rename link move or delete or rename original picture folder). That's it. Test the link by opening picture folder in home. Now you can see the pictures in external disk.
Bind pic folder in usb to default picture folder. Edit and add following line to /etc/fstab
/media/usb/ Pictures /home/ user/Pictures none rw,bind