diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-04-06 16:44:09 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-04-07 11:06:01 +0000 |
| commit | 20608c987b1668cb2b4e3cff7615577cd05c2075 (patch) | |
| tree | 85ed96cc6fb17c321b67aa7a16aa04cf986b1c82 | |
| parent | config: add tweak option to allow disabling sixels (diff) | |
config: fallback to /etc/xdg if XDG_CONFIG_DIRS is unset
Closes #1008
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | config.c | 6 | ||||
| -rw-r--r-- | doc/foot.ini.5.scd | 7 |
3 files changed, 10 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 16108adf..89639043 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,6 +98,8 @@ * Underline cursor sometimes being positioned too low, either making it look thinner than what it should be, or being completely invisible (https://codeberg.org/dnkl/foot/issues/1005). +* Fallback to `/etc/xdg` if `XDG_CONFIG_DIRS` is unset + (https://codeberg.org/dnkl/foot/issues/1008). ### Security @@ -444,10 +444,12 @@ open_config(void) } } - /* Finally, try foot/foot.ini in all XDG_CONFIG_DIRS */ + /* Finally, try foot/foot.ini in all XDG_CONFIG_DIRS, or /etc/xdg + * if unset */ const char *xdg_config_dirs = getenv("XDG_CONFIG_DIRS"); xdg_config_dirs_copy = xdg_config_dirs != NULL - ? strdup(xdg_config_dirs) : NULL; + ? strdup(xdg_config_dirs) + : strdup("/etc/xdg"); if (xdg_config_dirs_copy != NULL) { for (char *save = NULL, diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index fad39c09..594f893a 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -13,9 +13,10 @@ say if it needs to be reopened after any of the other sections. foot will search for a configuration file in the following locations, in this order: - - *XDG_CONFIG_HOME/foot/foot.ini* - - *~/.config/foot/foot.ini* - - *XDG_CONFIG_DIRS/foot/foot.ini* + - *XDG_CONFIG_HOME/foot/foot.ini* (defaulting to + *~/.config/foot/foot.ini* if unset) + - *XDG_CONFIG_DIRS/foot/foot.ini* (defaulting to + */etc/xdg/foot/foot.ini* if unset) # SECTION: main |
