Recently I found empty Folders “Bilder” (Pictures), “Downloads”, “Musik”, “Videos”, “Vorlagen” (Templates) in my folder $HOME/Dokumente - it is not the complete set defined in .config/user-dirs.dirs, and after I deleted them under “Dokumente”, they were back after a while - although I didn’t clearly trace after which action this happened (system update e.g. - or use of a certain program). I’m on xfce stable using play-on-linux (wine), some Java, some KDE and some gnome applications…
Can anyone help me to understand what may cause this behaviour and, maybe, stop it?
Many thanks!
P.S.
As jrichard326 found it’s wineconfig upon creating or updating a wine-prefix that creates the redundant folders in “Documents”. Now there’s a manual fix to change the “Desktop Integration” entries (maybe a wine-program is unhappy if there’s nothing for “Pictures” e.g. - so better not plainly delete them) for each existing wine-prefix, but here the next question arises: How to change the general wineconfig defaults to not create anything in “Documents”? I understand it as that this is not related to the XDG directories configuration, which does not include “Downloads” and “Templates” even in the commented section of user-dirs.defaults. Thank you
I believe it’s caused by /usr/lib/systemd/user/xdg-user-dirs-update.service.
Those particular directories ─ cough “folders”, pardon me ─ are defined by the freedesktop.org specifications, and they’ve been around for a while already, but apparently systemd feels the need to automatically recreate them if you delete them. The same thing was already true in sysvinit-based distributions a few years ago.
We are GNOME RedHat. The UNIX philosophy is irrelevant. Resistance is futile. You will be assimilated.
~/.config/user-dirs.dirs
-------------------------------------------------------------------------
# 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/Pulpit"
XDG_DOWNLOAD_DIR="$HOME/Pobrane"
XDG_TEMPLATES_DIR="$HOME/Szablony"
XDG_PUBLICSHARE_DIR="$HOME/Publiczny"
XDG_DOCUMENTS_DIR="$HOME/Dokumenty"
XDG_MUSIC_DIR="$HOME/Muzyka"
XDG_PICTURES_DIR="$HOME/Obrazy"
XDG_VIDEOS_DIR="$HOME/Wideo"
Also when I start or restart xdg-user-dirs-update.service or run xdg-user-dirs-update it don’t create any directories in ~/Documents/.
EDIT: I found those paths in /etc/xdg/user-dirs.defaults, but there are commented:
# Default settings for user directories
#
# The values are relative pathnames from the home directory and
# will be translated on a per-path-element basis into the users locale
DESKTOP=Desktop
DOWNLOAD=Downloads
TEMPLATES=Templates
PUBLICSHARE=Public
DOCUMENTS=Documents
MUSIC=Music
PICTURES=Pictures
VIDEOS=Videos
# Another alternative is:
#MUSIC=Documents/Music
#PICTURES=Documents/Pictures
#VIDEOS=Documents/Videos
Aha! I can reproduce it with winecfg only if I remove ~/.wine/ first. However, after that directory is populated again, if I run a Wine program like mp3tagAUR, it creates the folders again.
Here in winecfg under Desktop Integration with the links removed to those folders, the annoying, empty folders are not created. (xfce Unstable, wine 6.15-1) Running QuickPar and WinSCP after removing the links does not create the folders.
It remains to be seen if when Wine updates, if it recreates those folders.
No lag here. I use it very sparingly. Mostly the two programs mentioned and they are very small footprint, standalone type programs.
This annoys me almost as much as when I think it’s systemd or maybe pamac, I don’t recall puts that extra update notifier in session and startup (pamac tray budgie or something like that in etc/xdg/auto start)
The only time I have found when the XDG files are automatically created is when .config/user-dirs.dirs is removed (and the above setting is True) and the user logs off/on. The values in /etc/xdg/user-dirs.defaults are used.
KDE has a dialog to specify these locations and will update .config/user-dirs.dirs, but even in the dialog you have to create the directory. In KDE 4, a confirmation message would be displayed, “Do you want to move the directory”, but that doesn’t seem to be the case in Plasma.
In XFCE, I just manually create/move the directories and change the .config file to reflect these changes. The xdg-user-dirs-update --set NAME PATH can be used, but it just seems to update the .config file. There is a man page for xdg-user-dirs-update.
A user or application can query the key-value pair, xdg-user-dir NAME (i.e., xdg-user-dir MUSIC).