How to make home directories lowercase

I am setting up a fresh system and came across this problem and found this post:

It recommends changing the /etc/xdg/user-dir.defaults and running xdg-user-dirs-update --force.

As @computersavvy points out:

While those changes satisfy the requirement of new users having a lowercase home by default, it might not be the best approach for users on a shared system or users who prefer make all configuration changes from their home directory.

I want to recommend a more general solution.

The best practice is to override defaults using config files in the home directory. This keeps changes per-user and allows for easier tracking and porting of configuration changes.

To create ~/.config/user-dirs.dirs run:

xdg-user-dirs-update

~/.config/user-dirs.dirs will be populated with the defaults and contain something like this:

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"

Edit ~/.config/user-dirs.dirs changing the directory names to lowercase.

This updates the XDG environment variables so that the applications on your system can find and use the right directories, and prevents applications from re-creating the capitalized directories when they are no longer found.

Unfortunately, the directories still need to be renamed manually afterwards.

All you need to do is create a symbolic link or shortcut to the capitalized folder name with an all-lower-case name of your choosing:

u1@fedora:~$ ln -s Desktop/ desktop

Unlink it if you don’t want the shortcut anymore.

u1@fedora:~$ unlink desktop

This will cause unexpected behavior when cping files etc., wouldn’t it? You’d need to be mindful and use cp -rL and similar commands when backing up and transferring files.

It would also keep capitalized duplicates of everything in your home dir, right? (~/Downloads, ~/downloads, ~/Desktop, ~/desktop, etc.)

Yes, but one would be a link to the other, so there is actually only one copy.