26

I'd like to know if it's safe to rename user folders such as Desktop, Documents, Music (I want them to start lowercase).

Are there any programs in a default installation of Ubuntu (10.10/11.04) that expect those folders to exist and that cannot be configured to use different ones?

1
  • Yes, I kindof asked the same thing, just more specifically. But lorenzo-s's idea with the link is what I was looking for.
    – Wauzl
    May 14 '12 at 8:23
16

According to the Filesystem Hierarchy Standard in regard to /home directory, you can read:

/home is a fairly standard concept, but it is clearly a site-specific filesystem. The setup will differ from host to host. Therefore, no program should rely on this location.

Therefore an application that needs /home or even subfolders like /home/user/Music to run needs to be considered to have a bug.

Nevertheless, there may be applications that look up standard directories as defined by xdg-user-dirs, as BTW does your system when you change locale.

It may most likely be safe to simply rename standard folders in your home, but it is a much better idea to notify xdg-user-dirs the way lukasz already pointed out to avoid unwanted side effects from applications that rely on existing standard paths.

3
  • So basically a program either follows the XDG specs or it's worth a bug report. Sounds good to me - accepting, as the FHS quote seems important when answering this question (and lukasz already got 10 upvotes). ;-)
    – htorque
    Jan 21 '11 at 16:27
  • You've got my +1, because of (hard-coded /home/* names "...need to be considered to have a bug.. It doesn't mean that it's an "all-clear", but more like an evolution.. It seems that Nautilus is using it .. but who is not ..:)
    – Peter.O
    Jan 21 '11 at 16:41
  • @htouque ... I think you'll find that the "worth a bug-report" applies to anyone using a hard-coded /home ... and is not related to the XDG specs which would themselves break this "rule" if they hardcoded /home
    – Peter.O
    Jan 21 '11 at 16:46
25

You can rename the folders in the file $HOME/.config/user-dirs.dirs. Here's the default:

# 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"
2
  • @htorque, You're right, the file name is user-dir.dirs, sorry for a mistake
    – lukasz
    Jan 21 '11 at 15:59
  • 6
    Yes, you can change these directory names via /.config/user-dirs.dirs .. and actually you can change them directly in nautilus, and the changes reflect immediately back to this file ... Now thats all very nice and elegant, but it really doesn't say anything about the key point of htorques question, which is whether or not some programs are HARD-coded to ONLY refer tot he default names? ... in other words. Is it safe to assume that Everything uses this XDG_xxx_DIR thing? Should I assume that you have inferred this by your answer? ... That would be a dangerous assumption on my part!
    – Peter.O
    Jan 21 '11 at 16:09
7

I'm currently using Ubuntu 11.10 in German. I noticed, that the Desktop folder's name is "Arbeitsfläche". Unfortunately I am used to "cd Desktop" instead of "cd Arbeitsfläche". Is it possible to rename my Arbeitsfläche to Desktop without breaking my system? source

Create A Symbolic Link

You could either do a simple trick which would be to create a symbolic link to Arbeitsfläche. This is guaranteed to work!

cd ~; ln -s Arbeitsfläche Desktop

Modify the naming

The naming of these special folders can be specified by a set of variables. You would need to open the file ~/.config/user-dirs.dirs for editing and change the following line:

XDG_DESKTOP_DIR="$HOME/Arbeitsfläche"

to

XDG_DESKTOP_DIR="$HOME/Desktop"

Then you would need to create the appropriate directory and move your data from the old one to the new one. A log-in and log-out should be enough. Hopefully ;)

But with this solution, it is not impossible that some weirdly developed applications gets confused. Whereas with a symbolic link, this will always work!

6

I'm currently using Ubuntu 11.10 in German. I noticed, that the Desktop folder's name is "Arbeitsfläche". Unfortunately I am used to "cd Desktop" instead of "cd Arbeitsfläche". Is it possible to rename my Arbeitsfläche to Desktop without breaking my system? source

You can, see here.

You can just make a symbolic link.

ln -s ~/Arbeitsfläche ~/Desktop
4
  • 1
    The link solution is easy and will definetly not break my system. I made a symbolic link and after hid the Desktop link by putting "Desktop" in ~/.hidden. Now I can cd to Desktop and also see the fancy "Arbeitsfläche". Thanks ;)
    – Wauzl
    May 14 '12 at 8:21
  • Tell me a little bit more about the ~/.hidden folder. How can you ~$ cd Desktop if the folder is not in the home directory?
    – lorenzo-s
    May 14 '12 at 8:45
  • 3
    ~/.hidden is a file. If you include something in there Nautilus acts like that file or dir is hidden.
    – Rinzwind
    May 14 '12 at 8:54
  • @Rinzwind Thank you! Never heard about it. Unfortunately I'm a Xubuntu user, Thunar does not seems to implement this feature at the moment.
    – lorenzo-s
    May 14 '12 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.