From 972f11e9e4e69ce4c2c6f36a61e0bcae3c65cc08 Mon Sep 17 00:00:00 2001 From: Andreas Schuster Date: Thu, 19 Jun 2025 11:37:58 +0200 Subject: [PATCH] doc: develop: Add XDG_CONFIG_HOME information for zephyrrc The `zephyr-env.sh` script was adjusted to look for the zephyrrc file in three locations following the [XDG Base Directory Specification]. The documentation of the environment variables is now adjusted to reflect that change. [XDG Base Directory Specification]: (https://specifications.freedesktop.org/basedir-spec/latest/) Signed-off-by: Andreas Schuster --- doc/develop/env_vars.rst | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/develop/env_vars.rst b/doc/develop/env_vars.rst index fba31b7735e..47661c48024 100644 --- a/doc/develop/env_vars.rst +++ b/doc/develop/env_vars.rst @@ -88,8 +88,16 @@ your environment when you are using Zephyr. .. group-tab:: Linux/macOS - Create a file named :file:`~/.zephyrrc` if it doesn't exist, then add this - line to it: + Zephyr supports multiple locations for your :file:`zephyrrc` file, + following the XDG Base Directory Specification when possible. Create a + zephyrrc file in one of the following locations (they will be checked in + order): + + #. :file:`$XDG_CONFIG_HOME/zephyr/zephyrrc` + #. :file:`$HOME/.config/zephyr/zephyrrc` + #. :file:`$HOME/.zephyrrc` + + Add this line to the file in your preferred location: .. code-block:: console @@ -97,7 +105,8 @@ your environment when you are using Zephyr. To get this value back into your current terminal environment, **you must run** ``source zephyr-env.sh`` from the main ``zephyr`` repository. Among - other things, this script sources :file:`~/.zephyrrc`. + other things, this script sources your :file:`zephyrrc` (the first one it + finds from the list of locations above). The value will be lost if you close the window, etc.; run ``source zephyr-env.sh`` again to get it back.