-- Shared path constants for Omarchy's Hyprland Lua modules. -- Lua files loaded with require() have separate local scopes, so modules that -- need these paths import this table instead of repeating os.getenv() lookups. local home = os.getenv("HOME") -- A variable that is set but empty means "unset" (XDG Base Directory spec); -- bash's ${VAR:-fallback} in the sibling tools treats it the same way. local function env_or(name, fallback) local value = os.getenv(name) if value == nil or value == "" then return fallback end return value end return { home = home, config_home = env_or("XDG_CONFIG_HOME", home .. "/.config"), state_home = env_or("XDG_STATE_HOME", home .. "/.local/state"), omarchy_path = env_or("OMARCHY_PATH", "/usr/share/omarchy"), }