Hyprland Lua loaders hardcode $HOME/.config instead of honouring XDG_CONFIG_HOME #82
Labels
No labels
P0
P1
P2
P3
audio
bakery
boot
breadbug
bug
build
ci
dependencies
design
disk
docs
encryption
final
firewall
graphics
hardware
idle
installer
keybinds
nvidia
packages
phase-1
polish
recovery
reliability
reproducibility
secure-boot
security
shell
signing
snapshots
supply-chain
swap
tech-debt
theming
ux
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Breadway/bos#82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
How I found it
Setting up a sandboxed nested Hyprland session to test bos-settings: with
XDG_CONFIG_HOMEpointed at a copy of the config, the session still read the real~/.config/hypr/*.json.hyprland.lua,scripts/ui/settings.luaandscripts/display/monitors.luaall build paths fromos.getenv("HOME") .. "/.config/hypr/".Confidence
Medium. Observed; real-world impact only when XDG_CONFIG_HOME is set to something other than ~/.config.
Explanation
bos-settings writes
settings.json,monitors.json,binds.jsonandautostart.jsonunderdirs::config_dir()(which honours XDG_CONFIG_HOME), while the Lua loaders read from$HOME/.config. If a user sets XDG_CONFIG_HOME, every Settings change is written somewhere Hyprland never reads, silently. Expected: resolveos.getenv("XDG_CONFIG_HOME") or HOME .. "/.config"once and use it everywhere.PR opened: #96 (Breadway/bos #96)
Head SHA:
4d0f74b602One helper (scripts/lib/paths.lua) resolves the config dir; all loaders use it. Verified by a standalone lua/luajit check (18/18) on staged copies only, not in a live or nested Hyprland. Needs independent review.
Caveat on PR #96 (head
4d0f74b602): Unverified assumption (found after the PR was opened): hyprland.lua locates scripts/lib/paths.lua with debug.getinfo(1, "S").source. That only works if Hyprland loads the config as a file chunk (source starting with "@"). If Hyprland loads it from a string, the fallback is "." and dofile fails at the top of hyprland.lua, which would stop the whole config. The standalone test loads the file directly, so it does not cover this. Not verified against a live or nested Hyprland. Needs a check in a private nested session before merge, or a fallback to the XDG/HOME rule if source is not a path.