From 7ada6e7809391d3d4548ec523333d795023bfc09 Mon Sep 17 00:00:00 2001 From: laniakea64 Date: Fri, 20 Dec 2024 14:49:58 -0500 Subject: [PATCH] Update README.md --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 74e3d50918..f1d39e92d4 100644 --- a/README.md +++ b/README.md @@ -1927,8 +1927,14 @@ details. - `home_directory()` - The user's home directory. If you would like to use XDG base directories on all platforms you can use the -`env(…)` function with the appropriate environment variable, e.g., -`env('XDG_CACHE_HOME')`. +`env(…)` function with the appropriate environment variable and fallback, e.g. +```just +xdg_config_dir := if env('XDG_CONFIG_HOME', '') =~ '^/' { + env('XDG_CONFIG_HOME') +} else { + home_directory() / '.config' +} +``` ### Constants