nixers
XDG_CONFIG_HOME as ~/etc - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Operating Systems & Administration (https://nixers.net/Forum-Operating-Systems-Administration)
+--- Forum: Other *nix-like OSes & POSIX related (https://nixers.net/Forum-Other-nix-like-OSes-POSIX-related)
+--- Thread: XDG_CONFIG_HOME as ~/etc (/Thread-XDG-CONFIG-HOME-as-etc)


XDG_CONFIG_HOME as ~/etc - adi - 02-09-2023

What's your opinion on the following config:

Code:
export XDG_DATA_HOME=~/share
export XDG_CONFIG_HOME=~/etc
export XDG_STATE_HOME=~/local/state
export XDG_CACHE_HOME=~/var/cache
export XDG_RUNTIME_DIR=~/var/run

Make a lot of sense I believe.


RE: XDG_CONFIG_HOME as ~/etc - venam - 02-09-2023

It's always a good idea for a tidier home to override the XDG directories. It's easier to do with the ~/.config/user-dirs.dirs file or whatever is the default $XDG_CONFIG_HOME, but then it'll be a chicken and egg problem if you want this one defined too.
Some people had similar ideas in this thread but it was more generic.
I'd be interested in seeing how others do that these days, since there are different solutions.


RE: XDG_CONFIG_HOME as ~/etc - adi - 02-09-2023

(02-09-2023, 09:39 AM)venam Wrote: but then it'll be a chicken and egg problem if you want this one defined too.

I don't believe user-dirs.dirs is ment to handle $XDG_CONFIG_HOME, you set that as an environment variable in your ~/.profile. My $XDG_CONFIG_HOME/user.dirs.dirs, after running xdg-user-dirs-update --set DOWNLOAD ~/dl is:

Code:
# 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_DOWNLOAD_DIR="$HOME/dl"
XDG_DESKTOP_DIR="$HOME/Desktop"
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"

(02-09-2023, 09:39 AM)venam Wrote: Some people had similar ideas in this thread but it was more generic.

My $HOME is pretty similar:

Code:
~ $ tree -L 1
.
|-- Downloads
|-- bak
|-- bin
|-- dl
|-- docs
|-- etc
|-- go
|-- htdocs -> /var/www/home/adi/htdocs/
|-- include
|-- irc
|-- lib
|-- local
|-- mail
|-- man
|-- mnt
|-- pkg
|-- share
|-- src
|-- tmp
`-- var

19 directories, 1 file

I'm in the process of renaming ~/Downloads to ~/dl


RE: XDG_CONFIG_HOME as ~/etc - jkl - 02-09-2023

(02-09-2023, 01:33 PM)adi Wrote: I'm in the process of renaming ~/Downloads to ~/dl

Why?


RE: XDG_CONFIG_HOME as ~/etc - adi - 03-09-2023

(02-09-2023, 04:03 PM)jkl Wrote:
(02-09-2023, 01:33 PM)adi Wrote: I'm in the process of renaming ~/Downloads to ~/dl

Why?

Just consistency reasons.