Propagate OMARCHY_PATH and PATH to Hyprland-spawned processes; dev-link-aware paths.lua
Two related fixes for omarchy-dev-link to actually affect Hyprland keybinds:
default/hypr/paths.lua: prefer /etc/omarchy.conf over the process env.
hyprctl setenv updates Hyprland's process env, but the user-reported case
shows it doesn't reach bind-exec dispatchers because their env is
captured at config-load time. Reading the dev-link conf directly means
paths.omarchy_path is correct on every hyprctl reload regardless of
whether the launching Hyprland session re-read its env.
default/hypr/envs.lua: explicitly hl.env("OMARCHY_PATH", ...) and
hl.env("PATH", "$OMARCHY_PATH/bin:$PATH") so keybind dispatchers (and
everything else spawned by Hyprland) inherit the dev-link values. PATH
is built with a dedup pass so reloads don't accumulate the bin/ prefix.
Tested locally: paths.lua reads /etc/omarchy.conf correctly; lua syntax
of both files validates with luac -p.
This commit is contained in:
+22
-1
@@ -4,9 +4,30 @@
|
||||
|
||||
local home = os.getenv("HOME")
|
||||
|
||||
-- Resolve OMARCHY_PATH with omarchy-dev-link awareness. If /etc/omarchy.conf
|
||||
-- exists it wins over the process env, so dev-link takes effect even when
|
||||
-- Hyprland's own env is stale (the launching session never re-read the conf).
|
||||
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 = os.getenv("OMARCHY_PATH") or (home .. "/.local/share/omarchy"),
|
||||
omarchy_path = omarchy_path,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user