You are not logged in.

#1 2024-09-30 20:47:34

alleut
Member
Registered: 2016-04-29
Posts: 32

XDG_CONFIG_HOME is empty and the default fallback does not work

The env var XDG_CONFIG_HOME is empty and the path to `~/.config` is not resolved:

user@box ~ % echo $HOME
/home/user
user@box ~ % echo $XDG_CONFIG_HOME

user@box ~ % echo $XDG_CACHE_HOME

user@box ~ % echo $XDG_DATA_DIRS
/home/user/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/
user@box ~ % echo $XDG_RUNTIME_DIR
/run/user/1000

How can I fix it?

I've installed Arch using archinstall, if it's relevant.

Last edited by alleut (2024-09-30 20:48:07)

Offline

#2 2024-09-30 21:30:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,805

Re: XDG_CONFIG_HOME is empty and the default fallback does not work

"Not resolved" **by what**?
It's normal for the value not be set, client implementations should then default to ~/.config - so *what* client fails you is rather important here.

https://wiki.archlinux.org/title/XDG_Base_Directory

Offline

#3 2024-09-30 22:05:41

alleut
Member
Registered: 2016-04-29
Posts: 32

Re: XDG_CONFIG_HOME is empty and the default fallback does not work

Shouldn't something like `mkdir -p $XDG_CONFIG_HOME/someutil` work?

For example, how do I check this: "Should default to $HOME/.config."? echo is empty, mkdir -p $XDG_CONFIG_HOME/someutil doesn't work either.
Or, as a user, I cannot use this var and have to type ~/.config/someutil?

Offline

#4 2024-10-01 06:30:32

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,805

Re: XDG_CONFIG_HOME is empty and the default fallback does not work

Shouldn't something like `mkdir -p $XDG_CONFIG_HOME/someutil` work?

No. $XDG_CONFIG_HOME is a shell variable and not set, so it's resolved to an empty string.
The invoking script ("you") is responsible for handling the variable condition:

mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/someutil

Offline

#5 2024-10-01 10:27:21

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,060

Re: XDG_CONFIG_HOME is empty and the default fallback does not work

alleut, https://wiki.archlinux.org/title/XDG_user_directories should be interesting for you.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB