diff --git a/default/hypr/startup-cursor.lua b/default/hypr/startup-cursor.lua index b30ede4f..4744a724 100644 --- a/default/hypr/startup-cursor.lua +++ b/default/hypr/startup-cursor.lua @@ -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 diff --git a/test/shell.d/hyprland-startup-cursor-test.sh b/test/shell.d/hyprland-startup-cursor-test.sh index 447f84c5..b83be465 100755 --- a/test/shell.d/hyprland-startup-cursor-test.sh +++ b/test/shell.d/hyprland-startup-cursor-test.sh @@ -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"