Keep the default cursor alias on ordinary boots

Omarchy never sets XCURSOR_THEME, so asking GSettings on every cold boot replaced the "default" alias with whatever GSettings held, which is the schema default Adwaita when nothing was ever set. That overrode a theme chosen through ~/.icons/default and exported the substitute to every application. The saved theme and GSettings are now consulted only when recovering from the blank startup theme or an interrupted reveal.

Co-Authored-By: Codex XHigh <codex@openai.com>
This commit is contained in:
Spencer BullandCodex XHigh committed 2026-10-10 20:55:29 -05:00
1 parent f5170dd070
commit 0bcb6a2559
2 files changed
+9 -4

No files matched your search

+5 -4
View File
@@ -3,10 +3,11 @@ local function cursor_theme(value)
end
local function normal_theme(interrupted)
local theme = cursor_theme(os.getenv("XCURSOR_THEME"))
if not theme and (interrupted or os.getenv("XCURSOR_THEME") == "omarchy-startup") then
theme = cursor_theme(os.getenv("OMARCHY_STARTUP_CURSOR_THEME"))
end
local current = os.getenv("XCURSOR_THEME")
local theme = cursor_theme(current)
-- Only a lost preference needs recovering; an unset theme still means the default alias.
if theme or not (interrupted or current == "omarchy-startup") then return theme or "default" end
theme = cursor_theme(os.getenv("OMARCHY_STARTUP_CURSOR_THEME"))
if theme then return theme end
local pipe = io.popen("gsettings get org.gnome.desktop.interface cursor-theme 2>/dev/null", "r")
if pipe then
@@ -127,6 +127,10 @@ env.OMARCHY_STARTUP_CURSOR_PATH = "/stale/icons"
env.OMARCHY_STARTUP_CURSOR_SESSION = "old-session"
events["config.reloaded"]()
assert(omarchy_startup_cursor.xcursor == "next-theme" and omarchy_startup_cursor.path == "/next/icons", "a new session must honor changed cursor settings instead of inherited snapshots")
omarchy_startup_cursor_pending, omarchy_startup_cursor = nil, nil
env.XCURSOR_THEME, env.OMARCHY_STARTUP_CURSOR_SESSION, gsettings = "", "old-session", "'custom-cursor'\n"
events["config.reloaded"]()
assert(omarchy_startup_cursor.xcursor == "default", "an ordinary boot without a cursor theme keeps the default alias instead of adopting GSettings")
io.popen = popen
LUA
pass "the first compositor frame starts blank and the reveal restores user cursor settings"