Bug 500499 - Dolphin ignores XDG_USER_DIRS infrastructure?
Summary: Dolphin ignores XDG_USER_DIRS infrastructure?
Status: RESOLVED DUPLICATE of bug 445082
Alias: None
Product: dolphin
Classification: Applications
Component: panels: folders (other bugs)
Version First Reported In: 24.12.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-21 01:28 UTC by incansvl
Modified: 2025-02-21 21:40 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description incansvl 2025-02-21 01:28:49 UTC
SUMMARY
Per the Arch Wiki-
"xdg-user-dirs is a tool to help manage 'well known' user directories like the desktop folder and the music folder. It also handles localization (i.e. translation) of the filenames."

At startup Dolphin shows the users Home, plus the Desktop, Documents, Downloads etc. directories. These latter "well known" directories are precisely the ones xdg-user-dirs is designed to manage.

I plan to point all my users "well known" directories to a separate filesystem (partition) separate from the main OS partition. However, having set up the test config in ~/.config/user-dirs.dirs in my own account, I find that Dolphin ignores the folders configured there.

STEPS TO REPRODUCE
1. Change the configuration of the XDG_USER_DIRS, either by directly editing ~/.config/user-dirs.dirs, or using the KDE configuration "Locations" tool
2.Start Dolphin.
3.The "well known" dirs in the "Places" sidebar ignore the XDG configuration and instead show the unmodified defaults (e.g. ~/Documents, ~/Videos etc.)

OBSERVED RESULT
Dolphin ignores the customisation of well known user directories

EXPECTED RESULT
The Dolphin Places sidebar should be automatically synchronised with the "Locations" settings, which are reflected in ~/.config/user-dirs.dirs

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.2
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2
Kernel Version: 6.11.0-17-generic (64-bit)
Graphics Platform: Wayland
Comment 1 John 2025-02-21 10:53:48 UTC
Probably!
By default after installing the OS (Debian 13 - Trixie) I'm missing the Home and Trash folders on the Desktop and in the locations sidebar of Dolphin only Home and Trash are present (the ones that are missing from Desktop).
Even the Downloads is missing, which is pretty used these days, but I don't know who created it, maybe it was Firefox and if you never download anything is ok not to have it.
Maybe they are missing because they are too many and by default Dolphin opens in windowed mode.
So it could be intentional.

But as a multi-language user, similar to my parents and friends, I wish that such a standard works complete and as it should if there's a problem with it.
Comment 2 incansvl 2025-02-21 11:14:17 UTC
(In reply to John from comment #1)
> Probably!
> By default after installing the OS (Debian 13 - Trixie) I'm missing the Home
> and Trash folders on the Desktop and in the locations sidebar of Dolphin
> only Home and Trash are present (the ones that are missing from Desktop).
> Even the Downloads is missing, which is pretty used these days, but I don't
> know who created it, maybe it was Firefox and if you never download anything
> is ok not to have it.
> Maybe they are missing because they are too many and by default Dolphin
> opens in windowed mode.
> So it could be intentional.
> 
> But as a multi-language user, similar to my parents and friends, I wish that
> such a standard works complete and as it should if there's a problem with it.

Not quite sure this is the same aspect that you are referring to, but given that the well known folders and xdg-user-dirs infrastructure are only (by default) only set up for a user when that user logs in, I have ended up writing a script, to be run as admin/root, that forcibly creates all the well known folders for all the real (human) users, and then potentially writes the ~/.config/user-dirs.dirs file for each user.

Unfortunately, as logged in this bug, Dolphin at least doesn't take account of this so it is not robust.

My fallback solution is to look at the more traditional ways of doing this, using either symlinks or bind mounts. However given that the XDG_USER_DIRS mechanism is designed specifically for this purpose, it's annoying that it is only half-implemented.
Comment 3 Akseli Lahtinen 2025-02-21 12:17:06 UTC
I can't reproduce this with following steps:
1. Open dolphin
2. Create new folder with random name  to home directory
3. Open locations settings
4. Change the download folder to this new folder

For me the changes are reflected in the Dolphin places panel immediately.

However, if I modify the ~/.config/user-dirs.dirs file  directly, this update doesn't happen.

I am not sure if that is expected behavior or not, since updating from Locations settings it works for me.

dolphin 25.03.70
Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.80
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.12.15-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Comment 4 incansvl 2025-02-21 15:02:30 UTC
Ok that's interesting. However I am specifically looking for a solution that can be scripted.

My home PC has 6 user accounts. There are 8 "well known" folders per user in the XDG spec, and in the Locations tool by default. That is 6 logins and 48 manual edits to configure one machine. Should I subsequently decide to make a change such as moving the "user data" partition to a different mount point, that would mean another 48 edits.

I have been informed via a discussion on discuss.kde.org that Dolphin stores its data in ~/.local/share/user-places.xbelm so I could try to edit that as well, but it would be a lot nicer if this information was stored in one place, or at least could be managed (via a command line interface) at admin level from one simple command.
Comment 5 incansvl 2025-02-21 16:16:28 UTC
I just did a quick check and changes made to ~/.local/share/user-places.xbel are not automatically propagated forward to ~/.config/user-dirs.dirs, including after a restart of Dolphin, or logout+login. So it seems it is up to the application making the changes to keep this all in sync.

I have to say the option of using bind mounts is looking simpler, even if it does have some potential wrinkles.
Comment 6 Nate Graham 2025-02-21 21:40:22 UTC

*** This bug has been marked as a duplicate of bug 445082 ***