Thursday, September 21, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2288  / 1 Year ago, fri, april 15, 2022, 9:27:43

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)

Ideal setup (if permanent)

More From » nautilus


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.

enter image description here

[#32829] Sunday, April 17, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 207
Total Questions: 113
Total Answers: 94

Location: South Korea
Member since Sat, Oct 2, 2021
2 Years ago