rust-xdg icon indicating copy to clipboard operation
rust-xdg copied to clipboard

Wishlist: support other dirs (xdg-user-dirs, trash, etc)

Open o11c opened this issue 9 years ago • 11 comments

One of the things I never got around to adding support for was xdg-user-dirs - things like ~/Documents, ~/Music, etc.

This is more complicated because it involves reading the config from files instead of just the environment, and translating according to the current locale. Also xdg-user-dirs is not a spec, just a set of tools.

Trash is a spec though.

o11c avatar Sep 24 '15 19:09 o11c

There is no $(XDG_CONFIG_HOME)/user-dirs.dirs on my system, so it seems modern DEs don't care for running that tool.

whitequark avatar Sep 25 '15 08:09 whitequark

~/.config/user-dirs.dirs exists for me, do you have /etc/xdg/user-dirs.{conf,defaults} at least?

o11c avatar Sep 25 '15 15:09 o11c

Nope.

whitequark avatar Sep 25 '15 15:09 whitequark

Do you have any further suggestions on this topic?

whitequark avatar Nov 08 '15 17:11 whitequark

I have no clue, I'm honestly surprised that any desktop system does not have it.

o11c avatar Nov 08 '15 20:11 o11c

Ah, there's this... https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=599391

whitequark avatar Nov 09 '15 05:11 whitequark

I have this file (~/.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/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"

tbu- avatar Dec 19 '15 18:12 tbu-

Sure. What I'm saying is that KDE, at least on my system, doesn't write that file, and in fact doesn't even depend on whatever package xdg-user-dirs-update is in.

I have no objections to inclusion of a parser for this in the xdg crate, I just express my doubt about the usefulness of it.

whitequark avatar Dec 19 '15 18:12 whitequark

Although the fact that there's no specification is also troublesome... @o11c mentioned something about locale, where do I even get that information?

whitequark avatar Dec 19 '15 18:12 whitequark

I don't know, I don't need this feature, just wanted to provide information. Locale might come from this file:

$ hexdump -C ~/.config/user-dirs.locale
00000000  43                                                |C|
00000001

tbu- avatar Dec 19 '15 18:12 tbu-

I started working on implementing xdg-user-dirs, and I plan on implementing the Trash spec and possibly others as well.

m00nwtchr avatar Jul 20 '22 11:07 m00nwtchr