From 0bcb6a2559f85851fc46b7196ce0c5299af47b54 Mon Sep 17 00:00:00 2001 From: Spencer Bull Date: Sat, 10 Oct 2026 20:55:29 -0500 Subject: [PATCH] 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 --- default/hypr/startup-cursor.lua | 9 +++++---- test/shell.d/hyprland-startup-cursor-test.sh | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) 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"