feat: add hyprcursor theme build - #5
Open
MihkelMK wants to merge 3 commits into
Open
Conversation
Hyprcursor ships SVGs directly, so the themes are generated from the existing sources without cbmp or clickgen. Shape data (hotspots, aliases, animation frames) is read from configs/x.build.toml so both formats stay in sync from one config. - hotspots converted from px on the 256 canvas to a 0.0-1.0 fraction - x11_symlinks map to define_override, incl. legacy hash names - crosshair's stray #FE0000 is treated as #FF0000; render.json does not list it, leaving the dot unrecolored
hyprcursor-util is not packaged for Ubuntu and building it from source pulls the hyprutils/hyprlang chain, so the job runs on Arch where pacman has it. Needs neither node nor clickgen, since the SVG sources are packaged as-is. Expected shape count is derived from configs/x.build.toml so adding a cursor cannot silently pass the check.
Covers both theme layouts: the standalone Notwaita-*-Hyprcursor directory, and merging the files into an existing XCursor theme for setups that drive HYPRCURSOR_THEME and XCURSOR_THEME from one name. XCURSOR_THEME stays in the example config because XWayland and apps without hyprcursor support fall back to XCursor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Hyprcursor as a third output format alongside XCursor and Windows cursors.
Hyprcursor supports vector cursors.
The build packages SVGs from
svg/as-is withresize_algorithm = none, so onefile per shape covers every size instead of 14 pre-rendered bitmaps. No bitmap
step, so no
cbmporctgendependency.Approach
The script reads shape data from the existing
configs/x.build.tomlinstead ofduplicating it into a second config, keeping both formats in sync from one source:
x_hotspot = 37(px on the 256 canvas)hotspot_x = 0.144531(fraction)x11_symlinks = [...]define_override = ...watch-*.png, 14 baked sizesdefine_size = 0, watch-01.svg, 20x 60Colors come from
render.json, the same filecbmpuses, so the documentedcolor customization applies to Hyprcursors too.
Changes
scripts/gen-hyprcursor.py: generates the working state (recolored SVGs,meta.hl,manifest.hl) for all three variantsbuild-hyprcursor.sh: compiles withhyprcursor-util --createand packsbin/Notwaita-*-Hyprcursor.tar.xzyarn build:hyprcursor, plushyprcursors/in.gitignoreandcleanNotes
archlinux:latestcontainer. Ubuntu does not packagehyprcursor-util, and building it from source pulls the hyprutils/hyprlangchain, Arch ships it in
extra. The job needs neither node nor clickgen.svg/crosshair.svg:19uses#FE0000for a 4px dot.render.jsondoes notlist that value, so it stays red through recoloring. The generator maps
#FE0000to#FF0000(COLOR_FIXUPS). I left the SVG untouched so XCursoroutput does not change. Fixing the source is a separate task.
x.build.tomlomitssvg/person.svgandsvg/pin.svg, so the XCursor themeskips them. The Hyprcursor build skips them too, for parity.
Testing
Built all three variants, then loaded
Notwaita-Blackthrough thelibhyprcursorC API at size 24. All 58 shapes resolve, including overrides(
default,pointer) and the legacy hash names(
00008160000006810000408080010102). Animated shapes report 60 frames at 20ms,matching the XCursor timing. 173K per archive.
Ran the CI job end-to-end in a clean
archlinux:latestcontainer: 58 shapesper theme, all three archives produced.
Installed and tested locally, seems to work as intended.