From ac84c755a91d99b8c63749a701ac4c917dc40571 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Mon, 31 Mar 2025 19:27:33 +0000 Subject: [PATCH] set XDG vars to defaults if unset --- dot_config/environment | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dot_config/environment b/dot_config/environment index 6786a9a..561f1f9 100644 --- a/dot_config/environment +++ b/dot_config/environment @@ -1,8 +1,15 @@ #!/bin/sh + # icky, but necessary since this might inject the needed XDG vars . "$HOME/.config/environment.local" 2>/dev/null . "$XDG_DATA_HOME/cargo/env" 2>/dev/null +# set to defaults if any of these are unset +export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" +export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" +export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" + # runit export SVDIR="$XDG_STATE_HOME"/service