Skip to content

Commit 6649d37

Browse files
authored
feat!(hyprcursor): implement nominal_size metadata (#63)
requires hyprcursor at least 0.1.11 This will fix users having to set multiple sizes on hyprland
1 parent 14605ef commit 6649d37

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/generate-metadata

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,13 @@ for svg_file in svg_files:
100100
# Generate hypr cursor
101101
output_dir = hyprcursor_output_dir / basename
102102
output_dir.mkdir(parents=True, exist_ok=True)
103-
# hyprcursor has no concept of nominal size so calculate the hotspot based on real size.
104-
# users will have to set their hyprcursor to 1.333... times the size of GTK/XCursor size (https://github.com/catppuccin/cursors/pull/55#issuecomment-2502527484)
105103
hotspot_x = round(hotspot.x() / real_size, 4) # convert to hyprcursor's hotspot format
106104
hotspot_y = round(hotspot.y() / real_size, 4)
107105
with open(output_dir / "meta.hl", "w") as meta_file:
108106
meta_data = f"""resize_algorithm = none
109107
hotspot_x = {hotspot_x}
110-
hotspot_y = {hotspot_y}"""
108+
hotspot_y = {hotspot_y}
109+
nominal_size = {nominal_size / real_size}""" # calculate nominal ratio
111110
if len(frames) == 0:
112111
filename = svg_file.name
113112
shutil.copyfile(svg_file, output_dir / filename)

0 commit comments

Comments
 (0)