Xdg-users-dirs-update how to make folders permanent?

–force
Update existing user-dirs.dir, but force a full reset. This means: Don’t reset nonexisting directories to HOME, rather recreate the directory. Never use
backwards compatible non-translated names. Always recreate user-dirs.locale.

this is from the man page.

This is not working as it says it shoud.
Is it my English or does it says it creates a directory if it’s present in the user-dirs.dir file and not existing in the home folder?

If we can verify it’s not working as intended maybe we can tell the mantainers of the package?

It’ll recreate the directory if present in user-dirs.locale but not present in your $HOME.

user-dirs.locale it’s about the language used, in my case Italian, the content of the file is it_IT
nothing else.

I understant perfectly this is not an important topic.
It’s not like i have a problem that i want to solve, it’s more like i enjoy linux and the freedom it gives me so i want to understand for the sake of understand.
The pratical use of this is not so important, let’s see this as a didactic excercise :slight_smile:

1 Like

Well, I will certainly grant you that the manual isn’t very clear ─ I’m trying to refrain from saying “nonsensical”. :thinking:

–force
Update existing user-dirs.dir, but force a full reset. This means: Don’t reset nonexisting directories to HOME, rather recreate the directory.

I guess it all boils down to whatever is meant by the above. :astonished:


Okay, let’s get back to the top of the man page… :arrow_down:

xdg-user-dirs-update updates the current state of the users user-dirs.dir. If none existed before then one is created based on the system default values, or falling back to the old non-translated
       filenames if such directories exists. The list of old directories used are: ~/Desktop, ~/Templates and ~/Public.

       If an old configuration exists it is updated with any new default directories. Additionally, any configured directories that point to non-existing locations are reset by pointing then to the users
       home directory. This typically happens when the users removed the directory, so they likely don't want to use it anymore.

       On the first run a user-dirs.locale file is created containing the locale that was used for the translation. This is used later by GUI tools like xdg-user-dirs-gtk-update to detect if the locale was
       changed, letting you to migrate from the old names.

       xdg-user-dirs-update is normally run automatically at the start of a user session to update the XDG user dirs according to the users locale.

So, what xdg-user-dirs-update really does is rename those particular directories in the the user’s $HOME according to the user’s locale settings, and it does this by way of the file user-dirs.dirs.

Would you like to mess with this and experiment a little bit with it and make your own opinion?

this is what i understand it should be:

  • if you run xdg-user-dirs-update it updates the user-dirs.dir file, setting to home the not existing folders

  • if you run xdg-user-dirs-update --force it updates the folder making them coherent with the user-dir.dirs file.

I would really like to read your insight after testing out a little bit

Not really, no. :stuck_out_tongue:

This is my production system, and I don’t conduct any experiments with it. :wink:

That is how I understand it as well. :man_shrugging:

i have a virtualbox arch install too, and the behaviour is exaclty the same.
maybe i could bother them on their forum :stuck_out_tongue:

The XDG framework isn’t Arch-specific, though. That’s a freedesktop.org thing, which basically means RedHat. :thinking: