Files
arthur-os/default/hypr/paths.lua
T
Ryan Hughes a086b03dd1 Replace ~/.local/share/omarchy runtime paths with $OMARCHY_PATH
The git-era flow installed Omarchy to ~/.local/share/omarchy. In the
package-based flow it lives at /usr/share/omarchy (or, in dev mode, at
the path /etc/omarchy.conf's OMARCHY_PATH points at). Files that hard-
coded the old path broke on package installs:

- default/bash/rc: sourced ~/.local/share/omarchy/default/bash/*, so a
  fresh user's terminal logged ENOENT for every line. Now sources from
  $OMARCHY_PATH with /usr/share/omarchy as the safe default if the var
  is unset.

- config/systemd/user/omarchy-recover-internal-monitor.service:
  ExecStart pointed at %h/.local/share/omarchy/bin/. The script ships
  to /usr/bin via the omarchy-installer package; point straight there.

- install/config/xcompose.sh: wrote an XCompose include line pointing
  at the user-home path; use /usr/share/omarchy/ directly.

- default/hypr/paths.lua and config/hypr/hyprland.lua: fallback when
  OMARCHY_PATH is unset is /usr/share/omarchy, not the home path.

Dev-only scripts (omarchy-dev-add-migration, omarchy-reinstall-git) and
the SKILL.md docs still reference the old path; those are separate
cleanups since they don't affect a fresh install's runtime.
2026-06-04 18:34:35 -04:00

30 lines
951 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 "/usr/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,
}