Duplicate folders inside Documents - Pictures, Download, Videos, Music, Templates

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 noticed the same thing on GNOME, but haven’t figured out which program is causing it.

1 Like

I can confirm this, anyone else having this issue?

DeepinScreenshot_select-area_20210821160706

I observe same thing from several last weeks. I’m not sure, but I think that may be caused by update – creating times suggest me it.

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.

1 Like

It may be it, but I all paths looks ok:

~/.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

Running winecfg does that here. Xfce.

systemd use xdg config
we can test how to systemd view home-tree with systemd-path |grep ^user

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 mp3tag AUR, it creates the folders again.

1 Like

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.

1 Like

Are you also getting heavy lag running any Wine application lately? I’m using wine-staging 6.15-1.

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)

Exactly correct. Wine does this for any wine prefix by default.

Since when? It’s only recently this has started happening.

6.x series as far as I know. Even on *buntu-based distros.

Uncheck the “Integrations” under winecfg or reconfigure them. I think you’ll still need to delete the empty folders afterwards.

If you don’t want the XDG directories:

  • Checkout the file /etc/xdg/user-dirs.conf.
  • Either make changes there or copy to $HOME/.config.
  • Change the key-value pair, enabled=True to enabled=False.
  • There is also a man page.

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).

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.