Cursor: also install as Xcursor default theme so Steam/Proton pick it up

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
This commit is contained in:
nico
2026-09-20 00:31:47 +02:00
parent 3508e70b93
commit c47d314860
2 changed files with 8 additions and 1 deletions

View File

@@ -46,7 +46,7 @@ The mouse cursor is a custom theme, `ArchLogo`, with every shape redrawn in the
- **Everything else** — text I-beam, resize arrows (edges, corners, column/row, all-direction), crosshair, cell, grab/grabbing hand, zoom, X, and a red not-allowed sign. These have a dark outline plus a light rim so they stay visible on blue or dark backgrounds
- **Animated** — `wait` is a spinning ring, `progress` is the arrow with a small spinner badge
The artwork is drawn procedurally in [`hypr/cursor/shapes.py`](hypr/cursor/shapes.py); [`hypr/cursor/build.py`](hypr/cursor/build.py) renders it (needs `rsvg-convert` and `hyprcursor-util`) into a Hyprcursor theme for Hyprland and an XCursor theme for GTK/Qt/XWayland apps, both installed to `~/.local/share/icons/ArchLogo`. Adwaita is only used as the shape/alias list and fallback. After editing `shapes.py`, run `python3 hypr/cursor/build.py` and `hyprctl setcursor ArchLogo 24`. `hyprland.lua` sets the theme via `XCURSOR_THEME` / `HYPRCURSOR_THEME` and gsettings.
The artwork is drawn procedurally in [`hypr/cursor/shapes.py`](hypr/cursor/shapes.py); [`hypr/cursor/build.py`](hypr/cursor/build.py) renders it (needs `rsvg-convert` and `hyprcursor-util`) into a Hyprcursor theme for Hyprland and an XCursor theme for GTK/Qt/XWayland apps, both installed to `~/.local/share/icons/ArchLogo`. Adwaita is only used as the shape/alias list and fallback. It also writes `~/.local/share/icons/default/index.theme` (`Inherits=ArchLogo`), Xcursor's fallback theme, so apps that never see `XCURSOR_THEME` (Steam and Proton games started before the env was set) get the cursor too — restart Steam once after installing. After editing `shapes.py`, run `python3 hypr/cursor/build.py` and `hyprctl setcursor ArchLogo 24`. `hyprland.lua` sets the theme via `XCURSOR_THEME` / `HYPRCURSOR_THEME` and gsettings.
## Theming (aether)

View File

@@ -168,6 +168,13 @@ def main():
sys.exit(f"no artwork for cursor shape '{n}'")
with open(os.path.join(DEST, "index.theme"), "w") as f:
f.write(f"[Icon Theme]\nName={NAME}\nComment={DESC}\nInherits={os.path.basename(BASE)}\n")
# Xcursor's fallback theme is "default": apps that never see XCURSOR_THEME (Steam, Proton
# containers, anything started before the env was set) land here and get ours too.
fallback = os.path.join(os.path.dirname(DEST), "default", "index.theme")
if not os.path.exists(fallback) or NAME in open(fallback).read():
os.makedirs(os.path.dirname(fallback), exist_ok=True)
with open(fallback, "w") as f:
f.write(f"[Icon Theme]\nName=Default\nComment=Points at {NAME}\nInherits={NAME}\n")
finally:
shutil.rmtree(tmp, ignore_errors=True)
print(f"installed {NAME} -> {DEST}")