Files
arthur-os/default/hypr/paths.lua
T
Ryan Hughes b887d18b84 Trim over-commented Chunk 3+/4 work
A pass over the install scripts, dev-tools commands, and Hyprland Lua
files that I had stuffed with explain-everything preambles. Most of
those rationales (which files ship where, why hyprctl setenv doesn't
suffice, etc.) belong in commit messages or PR descriptions, not in
code people have to read forever. Kept the few comments that document
genuinely non-obvious behaviour: the keybind-env reason for hl.env in
envs.lua, why the runtime PAM seds stay scripted in
increase-lockout-limit, the chroot/--now distinction in chroot.sh, and
the dev-pkg-test split-install reason.
2026-06-04 18:34:35 -04:00

30 lines
964 B
Lua

-- 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")
-- /etc/omarchy.conf wins over process env so dev-link survives stale sessions.
local function read_dev_link_omarchy_path()
local f = io.open("/etc/omarchy.conf", "r")
if not f then return nil end
local value
for line in f:lines() do
local v = line:match('^%s*export%s+OMARCHY_PATH=%s*"?([^"\n]+)"?')
if v and #v > 0 then value = v end
end
f:close()
return value
end
local omarchy_path = read_dev_link_omarchy_path()
or os.getenv("OMARCHY_PATH")
or (home .. "/.local/share/omarchy")
return {
home = home,
config_home = os.getenv("XDG_CONFIG_HOME") or (home .. "/.config"),
state_home = os.getenv("XDG_STATE_HOME") or (home .. "/.local/state"),
omarchy_path = omarchy_path,
}