From 3508e70b935a963094e6e4f80dc9f7495260212d Mon Sep 17 00:00:00 2001 From: nico Date: Sat, 19 Sep 2026 22:30:57 +0200 Subject: [PATCH] Add custom ArchLogo cursor theme (Hyprcursor + XCursor), document it Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94 --- README.md | 13 +- hypr/cursor/__pycache__/build.cpython-314.pyc | Bin 0 -> 12093 bytes .../cursor/__pycache__/shapes.cpython-314.pyc | Bin 0 -> 14259 bytes hypr/cursor/build.py | 177 +++++++++++++++++ hypr/cursor/shapes.py | 187 ++++++++++++++++++ hypr/hyprland.lua | 7 + 6 files changed, 383 insertions(+), 1 deletion(-) create mode 100644 hypr/cursor/__pycache__/build.cpython-314.pyc create mode 100644 hypr/cursor/__pycache__/shapes.cpython-314.pyc create mode 100644 hypr/cursor/build.py create mode 100644 hypr/cursor/shapes.py diff --git a/README.md b/README.md index bce0d13..d094388 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ My personal dotfiles for a [Hyprland](https://hyprland.org/) desktop on Arch Lin | Bar | Custom [Quickshell](https://quickshell.org/) shell (`quickshell/default/`) — replaces Waybar entirely | | Launcher | Rofi | | Terminal | Kitty | +| Cursor | Custom Arch-logo cursor set (pointer, text, resize, wait spinner, …) in the rice palette — artwork in [`shapes.py`](hypr/cursor/shapes.py), [`build.py`](hypr/cursor/build.py) installs a Hyprcursor and an XCursor theme to `~/.local/share/icons/ArchLogo` | | Notifications | [mako](mako/) — themed via aether, same as the rest | | Theming | [aether](aether/) — palette-driven theme generator | | Qt/GTK theming | qt5ct, qt6ct, nwg-look | @@ -37,6 +38,16 @@ All the stats are pulled by small shell scripts in `quickshell/default/scripts/` Hyprland itself is configured via [`hypr/hyprland.lua`](hypr/hyprland.lua) (Hyprland's Lua config API) — that's the active config; `hyprland.conf` is kept around for reference but is no longer loaded. One consequence: `hyprctl dispatch` (and anything sending it a raw dispatch string, like this bar's workspace/window-switcher clicks) needs the new `hl.dsp.*` Lua-expression syntax instead of the classic one, e.g. `hl.dsp.focus({workspace = 1})` rather than `workspace 1`. +## Cursor + +The mouse cursor is a custom theme, `ArchLogo`, with every shape redrawn in the rice style instead of only the arrow: + +- **Default pointer** — the Arch logo, rotated like a classic arrow, plain accent blue without an outline. Copy / context-menu / alias / help / no-drop are the same arrow with a small badge, and the link pointer is the logo upright +- **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. + ## Theming (aether) The color palette lives in [`aether/`](aether/) and is the single source of truth — [`aether/theme/colors.toml`](aether/theme/colors.toml) defines the palette, and aether renders it out into per-app configs (Hyprland, Kitty, Rofi, Waybar-era CSS, btop, Zed, etc.), most of which get `@import`ed or sourced by that app's real config rather than edited directly. The bar's own colors in `Bar.qml` are hand-matched to this palette rather than generated, since Quickshell reads QML, not CSS. @@ -117,7 +128,7 @@ Beyond Hyprland itself, the bar's scripts expect: `quickshell`, `nmcli`, `wpctl` ## Layout ``` -hypr/ Hyprland config (hyprland.lua is active, .conf kept for reference) + wallpaper.png +hypr/ Hyprland config (hyprland.lua is active, .conf kept for reference) + wallpaper.png + cursor/ (cursor theme source) quickshell/ The bar (Bar.qml + helper QML components + scripts/) rofi/ Launcher config + theme kitty/ Terminal config + theme diff --git a/hypr/cursor/__pycache__/build.cpython-314.pyc b/hypr/cursor/__pycache__/build.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4de9b5be8efe57bd5704ad1d79ed267eacc2962c GIT binary patch literal 12093 zcmbt44Nx0bdb`p}TK!A>gK-c)HkQqgZAh>I+rfYVV`EtG;y4&iNJ1zUlDxa(M|YQy zo3_D@6Xe7>Na~x&*JMoQoSvr5b-120@m<>)&)lUICotTaUT@mW+_=-u*l}hum(H~P z-byR2I1-%P1HHGq@4fGR?|a|h``+7Q&}%SA|NHyDe(t?I4EqoCA|^%R;n6gXVbd6e zao8Y6;T<@K3#E*c38kEq3njr3LaE>sLaF4GLaE|ZLP>JuIlMbV1fMFqvs2IF)0ec& z73)*wIbAK_hmu%w`Y-9dJ>E{5pVL#aT3P%HXQbqui6S`jm-OEu?HPZj6z9x3Y`-iy zb|$6cvZ^pje+uWap)^35Ln(7HE|*e4o=1_8=TmCP3n&fb+s+kI+5=}W%mHgrh@IP3 zjMXLvDgt_!3O}pS_AfBaqXD%~ zg=NCcjS5X2&JkO{!&z($q-KvEwdll}6Le z_#6SdleG-{0NRL;8MAS$#qH&MmglRhJU+Y4Q_YUr7-zNH?(?$MB3AVpi>1;sI^|~) z*zL0W#{6!N(-FrjRZ|(@+#V|eZE1(*9-G%;adWKGGa`UE(;T1Ot_jA?aZazr;bxq6 z&NEeE@%k*2ap*4i?sYmHPDdP2TVH2&4_AGr-!>({v-$n3rghxOOj!U~zY`{I<1B90 zTh47lp%I(M!@_sQ7jOXueIiML99=L7TW?{2I+ZYAfXG!yW+}|2!h)udScb&nAd*?C z11uvYR+XkJXxu>aVBW@7)d@&EDbhBWy(#JK2{smZM+dnaevif>o5lu&k0|Swwn}_0 z2H~b~N=C^CM4`v%q&QK;re75_KA;rAR%s|DrK(H72DT+jF{}Cuos>{PS>*^X_j_IN zFaf_&`1$&*IIpmeI_>AXtOT!N1H*pC2mHqJawg#A2sz!`e9p{SbVI(b8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diff --git a/hypr/cursor/build.py b/hypr/cursor/build.py new file mode 100644 index 0000000..7568092 --- /dev/null +++ b/hypr/cursor/build.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python3 +"""Build the "ArchLogo" cursor theme: every Adwaita cursor shape redrawn in the +rice style (artwork in shapes.py: Arch-logo pointer, blue + dark outline). + +Produces both formats into ~/.local/share/icons/ArchLogo: + - hyprcursor (compiled with hyprcursor-util) for Hyprland itself + - XCursor (written directly, no xcursorgen needed) for GTK/Qt/XWayland apps +Adwaita is only used as the shape list / alias map and as the fallback theme. + +Needs: rsvg-convert, hyprcursor-util, and Adwaita cursors in /usr/share/icons. +""" +import os +import re +import shutil +import struct +import subprocess +import sys +import tempfile +import zlib + +HERE = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, HERE) +from shapes import SHAPES, DELAY_MS # noqa: E402 + +BASE = "/usr/share/icons/Adwaita" +NAME = "ArchLogo" +DEST = os.path.expanduser(f"~/.local/share/icons/{NAME}") +DESC = "Arch-logo cursor set in the rice palette" + +# Same sizes Adwaita's hyprcursor extraction uses, plus a few X11 favourites. +HYPR_SIZES = [24, 30, 36, 48, 72, 96] +XCURSOR_SIZES = [24, 30, 32, 36, 48, 64, 72, 96] + +_cache = {} + + +def render(svg, size): + """SVG string -> (w, h, rows of RGBA bytes), cached (hypr and X sizes overlap).""" + key = (svg, size) + if key not in _cache: + png = subprocess.run(["rsvg-convert", "-f", "png", "-w", str(size), "-h", str(size)], + input=svg.encode(), capture_output=True, check=True).stdout + _cache[key] = (png, read_png(png)) + return _cache[key] + + +def read_png(d): + """Minimal decoder for the 8-bit RGBA non-interlaced PNGs rsvg-convert writes.""" + p, idat = 8, b"" + while p < len(d): + ln, typ = struct.unpack(">I4s", d[p:p + 8]) + body = d[p + 8:p + 8 + ln] + p += 12 + ln + if typ == b"IHDR": + w, h, bd, ct, _, _, il = struct.unpack(">IIBBBBB", body) + assert (bd, ct, il) == (8, 6, 0), "expected 8-bit RGBA, non-interlaced" + elif typ == b"IDAT": + idat += body + raw, stride, prev, i, rows = zlib.decompress(idat), w * 4, bytearray(w * 4), 0, [] + for _ in range(h): + f, line = raw[i], bytearray(raw[i + 1:i + 1 + stride]) + i += 1 + stride + for x in range(stride): + a = line[x - 4] if x >= 4 else 0 + b = prev[x] + c = prev[x - 4] if x >= 4 else 0 + if f == 1: + line[x] = (line[x] + a) & 255 + elif f == 2: + line[x] = (line[x] + b) & 255 + elif f == 3: + line[x] = (line[x] + ((a + b) >> 1)) & 255 + elif f == 4: + pa, pb, pc = abs(b - c), abs(a - c), abs(a + b - 2 * c) + line[x] = (line[x] + (a if pa <= pb and pa <= pc else (b if pb <= pc else c))) & 255 + rows.append(line) + prev = line + return w, h, rows + + +def xcursor_image(svg, size, hot, delay): + png, (w, h, rows) = render(svg, size) + pix = bytearray() + for r in rows: + for x in range(w): + R, G, B, A = r[x * 4:x * 4 + 4] + # XCursor stores premultiplied ARGB, little-endian + pix += struct.pack(" 1 else 0 + # a reader picks the best size, then plays every chunk of that size in TOC order + chunks = [xcursor_image(f, s, hot, delay) for s in XCURSOR_SIZES for f in frames] + off = 16 + 12 * len(chunks) + toc, body = b"", b"" + for data, size in chunks: + toc += struct.pack("<3I", 0xFFFD0002, size, off + len(body)) + body += data + with open(path, "wb") as f: + f.write(struct.pack("<4s3I", b"Xcur", 16, 0x10000, len(chunks)) + toc + body) + + +def write_hypr_shape(shape_dir, name, hot, frames): + """Replace one extracted Adwaita shape (PNGs + meta.hl), keeping its define_override aliases.""" + meta_path = os.path.join(shape_dir, "meta.hl") + overrides = re.findall(r"^define_override.*$", open(meta_path).read(), re.M) + for f in os.listdir(shape_dir): + if f.endswith(".png"): + os.remove(os.path.join(shape_dir, f)) + lines = ["resize_algorithm = none", f"hotspot_x = {hot[0] / 256:.4f}", f"hotspot_y = {hot[1] / 256:.4f}", ""] + n = 0 + for f in frames: + for s in HYPR_SIZES: + fn = f"{name}_{n:03d}.png" + open(os.path.join(shape_dir, fn), "wb").write(render(f, s)[0]) + lines.append(f"define_size = {s}, {fn}, {DELAY_MS if len(frames) > 1 else 50}") + n += 1 + open(meta_path, "w").write("\n".join(lines + [""] + overrides) + "\n") + + +def main(): + for tool in ("rsvg-convert", "hyprcursor-util"): + if not shutil.which(tool): + sys.exit(f"missing dependency: {tool}") + cur_base = os.path.join(BASE, "cursors") + if not os.path.isdir(cur_base): + sys.exit(f"base cursor theme not found: {BASE}") + + tmp = tempfile.mkdtemp(prefix="archcursor-") + try: + # --- hyprcursor: extract Adwaita, swap every shape, recompile --- + subprocess.run(["hyprcursor-util", "--extract", BASE, "--output", tmp], check=True, stdout=subprocess.DEVNULL) + src = os.path.join(tmp, "extracted_" + os.path.basename(BASE)) + hdir = os.path.join(src, "hyprcursors") + for name in sorted(os.listdir(hdir)): + if name not in SHAPES: + sys.exit(f"no artwork for cursor shape '{name}'") + write_hypr_shape(os.path.join(hdir, name), name, *SHAPES[name]) + manifest = os.path.join(src, "manifest.hl") + text = open(manifest).read() + text = re.sub(r"name = .*", f"name = {NAME}", text) + text = re.sub(r"description = .*", f"description = {DESC}", text) + open(manifest, "w").write(text) + + out = os.path.join(tmp, "out") + os.makedirs(out) + subprocess.run(["hyprcursor-util", "--create", src, "--output", out], check=True, stdout=subprocess.DEVNULL) + built = [d for d in os.listdir(out) if os.path.exists(os.path.join(out, d, "manifest.hl"))] + if len(built) != 1: + sys.exit(f"unexpected hyprcursor-util output: {os.listdir(out)}") + + shutil.rmtree(DEST, ignore_errors=True) + shutil.copytree(os.path.join(out, built[0]), DEST) + + # --- XCursor: one file per real shape, Adwaita's alias names symlinked to them --- + cur = os.path.join(DEST, "cursors") + os.makedirs(cur, exist_ok=True) + for n in sorted(os.listdir(cur_base)): + p = os.path.join(cur_base, n) + if os.path.islink(p): + os.symlink(os.path.basename(os.path.realpath(p)), os.path.join(cur, n)) + elif n in SHAPES: + write_xcursor(os.path.join(cur, n), *SHAPES[n]) + else: + 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") + finally: + shutil.rmtree(tmp, ignore_errors=True) + print(f"installed {NAME} -> {DEST}") + + +if __name__ == "__main__": + main() diff --git a/hypr/cursor/shapes.py b/hypr/cursor/shapes.py new file mode 100644 index 0000000..d39eaec --- /dev/null +++ b/hypr/cursor/shapes.py @@ -0,0 +1,187 @@ +"""Cursor artwork for the ArchLogo theme, drawn procedurally as SVG. + +Everything lives in a 256x256 box. Style: accent-blue shapes with a dark outline, +the Arch logo as the pointer, red only for "forbidden". SHAPES maps each XCursor +name to (hotspot in that box, [svg frames]); more than one frame = animated. +""" + +OUT = "#0b1a26" # outline +BLUE = "#1793d1" # accent (aether color for the rice) +LIGHT = "#e6f1f8" +TRACK = "#2a4a63" +RED = "#e5546b" + +ARCH = ("m127.98 12.07c-10.316 25.309-16.543 41.855-28.031 66.41 7.043 7.4609 15.691 16.156 29.734 25.977-15.098-6.207-25.395-12.445-33.094-18.918-14.703 30.68-37.742 74.391-84.492 158.39 36.746-21.219 65.23-34.293 91.773-39.289-1.1406-4.8945-1.7852-10.195-1.7422-15.734l0.042969-1.1719c0.58203-23.551 12.828-41.645 27.336-40.418 14.508 1.2266 25.781 21.316 25.199 44.867-0.10938 4.4219-0.60938 8.6914-1.4805 12.641 26.258 5.1328 54.438 18.18 90.684 39.105-7.1484-13.156-13.527-25.016-19.621-36.316-9.5938-7.4336-19.605-17.117-40.023-27.594 14.035 3.6406 24.082 7.8516 31.914 12.555-61.941-115.32-66.957-130.66-88.199-180.5z") + +DEFS = f'' +FRAMES = 20 +DELAY_MS = 50 + + +def svg(body): + return f'{DEFS}{body}' + + +# --- primitives: F = filled shape, S = stroked line; lay() draws outlines first, then colours --- +def F(markup, color=BLUE): + return ("f", markup, 0, color) + + +def S(markup, w, color=BLUE): + return ("s", markup, w, color) + + +HALO = 16 # extra light rim outside the dark outline, so the cursor also reads on blue/dark backgrounds + + +def lay(items, ow=18): + halo, dark, top = [], [], [] + for kind, m, w, c in items: + if kind == "f": + halo.append(f'{m}') + dark.append(f'{m}') + top.append(f'{m}') + else: + cap = 'stroke-linecap="round" stroke-linejoin="round"' + halo.append(f'{m}') + dark.append(f'{m}') + top.append(f'{m}') + return "".join(halo + dark + top) + + +def poly(pts): + return f'' + + +def line(x1, y1, x2, y2): + return f'' + + +def rot(body, deg): + return f'{body}' + + +def glyph(d, w, color=OUT): + return f'' + + +# --- pointers ------------------------------------------------------------------------------- +def arrow(scale=1.0, outline=True): + if not outline: + return f'' + g = ('' + f'' + f'' + f'') + if scale != 1.0: + g = f'{g}' + return g + + +def badge(items): + return lay(items) + + +BX, BY = 194, 194 # badge centre next to the small arrow + + +def badged(inner): + return svg(arrow(0.72) + inner) + + +def light_badge(glyphs): + return lay([F(f'', LIGHT)]) + glyphs + + +UPRIGHT = ('' + f'' + f'' + f'') + + +# --- resize family -------------------------------------------------------------------------- +DOUBLE = poly([(24, 128), (80, 80), (80, 112), (176, 112), (176, 80), (232, 128), + (176, 176), (176, 144), (80, 144), (80, 176)]) +COL = (poly([(24, 128), (72, 84), (72, 112), (104, 112), (104, 144), (72, 144), (72, 172)]) + + poly([(232, 128), (184, 84), (184, 112), (152, 112), (152, 144), (184, 144), (184, 172)])) +QUAD = poly([(128, 24), (172, 68), (144, 68), (144, 112), (188, 112), (188, 84), (232, 128), + (188, 172), (188, 144), (144, 144), (144, 188), (172, 188), (128, 232), + (84, 188), (112, 188), (112, 144), (68, 144), (68, 172), (24, 128), + (68, 84), (68, 112), (112, 112), (112, 68), (84, 68)]) + +IBEAM = [S(line(128, 56, 128, 200), 18), S(line(92, 56, 164, 56), 18), S(line(92, 200, 164, 200), 18)] +PLUS_FAT = poly([(104, 40), (152, 40), (152, 104), (216, 104), (216, 152), (152, 152), + (152, 216), (104, 216), (104, 152), (40, 152), (40, 104), (104, 104)]) + + +def hand(fingers, thumb=True): + parts = [F('')] + for x, y in fingers: + parts.append(F(f'')) + if thumb: + parts.append(F('')) + return svg(lay(parts)) + + +def ring(angle_deg=0, cx=128, cy=128, r=84, w=28, scale=1.0): + d = f"M{cx} {cy - r} A{r} {r} 0 1 1 {cx - r} {cy}" + track = f'' + arc = f'' + return lay([S(track, w, TRACK), S(arc, w)]) + + +def build(): + one = lambda hot, body: (hot, [svg(body)]) + c = (128, 128) + a = (14, 14) + forbidden = lay([S('', 26, RED), S(line(66, 66, 190, 190), 26, RED)]) + zoom = lambda plus: svg(lay([S('', 20), S(line(156, 156, 224, 224), 30)] + + [S(line(78, 108, 138, 108), 14, LIGHT)] + + ([S(line(108, 78, 108, 138), 14, LIGHT)] if plus else []))) + + shapes = { + "default": one(a, arrow(outline=False)), + "context-menu": one(a, badged(light_badge( + glyph("M172 180H216M172 196H216M172 212H216", 9)))), + "copy": one(a, badged(light_badge(glyph("M194 170V218M170 194H218", 12)))), + "alias": one(a, badged(light_badge( + glyph("M172 216C172 190 186 182 208 182", 11) + + f''))), + "no-drop": one(a, badged(lay([S(f'', 14, RED), + S(line(BX - 24, BY - 24, BX + 24, BY + 24), 14, RED)], 10))), + "help": one(a, badged(light_badge( + glyph("M176 182C176 166 210 164 212 182C214 198 196 198 196 210", 11) + + f''))), + "not-allowed": one(c, forbidden), + "pointer": one((128, 30), UPRIGHT), + "text": one(c, lay(IBEAM)), + "vertical-text": one(c, rot(lay(IBEAM), 90)), + "crosshair": one(c, lay([S(line(128, 26, 128, 104), 16), S(line(128, 152, 128, 230), 16), + S(line(26, 128, 104, 128), 16), S(line(152, 128, 230, 128), 16), + F('')])), + "cell": one(c, lay([F(PLUS_FAT)])), + "X_cursor": one(c, lay([S(line(52, 52, 204, 204), 28), S(line(204, 52, 52, 204), 28)])), + "ew-resize": one(c, lay([F(DOUBLE)])), + "ns-resize": one(c, rot(lay([F(DOUBLE)]), 90)), + "nesw-resize": one(c, rot(lay([F(DOUBLE)]), -45)), + "nwse-resize": one(c, rot(lay([F(DOUBLE)]), 45)), + "col-resize": one(c, lay([F(COL), S(line(128, 60, 128, 196), 16)])), + "row-resize": one(c, rot(lay([F(COL), S(line(128, 60, 128, 196), 16)]), 90)), + "all-resize": one(c, lay([F(QUAD)])), + "all-scroll": one(c, lay([F(QUAD)])), + "grab": one((128, 104), hand([(76, 76), (104, 52), (132, 60), (160, 84)])), + "grabbing": one(c, hand([(76, 104), (104, 100), (132, 102), (160, 108)])), + "zoom-in": one((108, 108), zoom(True)), + "zoom-out": one((108, 108), zoom(False)), + "wait": (c, [svg(ring(i * 360 / FRAMES)) for i in range(FRAMES)]), + "progress": (a, [svg(arrow(0.72) + ring(i * 360 / FRAMES, BX, BY, 30, 14)) for i in range(FRAMES)]), + } + # single-ended resize cursors (the window-edge ones) reuse the double-headed arrows + for name, src in {"e-resize": "ew-resize", "w-resize": "ew-resize", "n-resize": "ns-resize", + "s-resize": "ns-resize", "ne-resize": "nesw-resize", "sw-resize": "nesw-resize", + "nw-resize": "nwse-resize", "se-resize": "nwse-resize"}.items(): + shapes[name] = shapes[src] + return shapes + + +SHAPES = build() diff --git a/hypr/hyprland.lua b/hypr/hyprland.lua index b35d8df..4068f50 100644 --- a/hypr/hyprland.lua +++ b/hypr/hyprland.lua @@ -57,6 +57,11 @@ hl.env("XCURSOR_SIZE", 24) hl.env("HYPRCURSOR_SIZE", 24) +-- Arch-logo pointer, built by hypr/cursor/build.py into ~/.local/share/icons/ArchLogo +hl.env("XCURSOR_THEME", "ArchLogo") + +hl.env("HYPRCURSOR_THEME", "ArchLogo") + hl.env("QT_QPA_PLATFORM", "wayland;xcb") hl.env("GDK_BACKEND", "wayland,x11") @@ -605,4 +610,6 @@ end) hl.on("config.reloaded", function() hl.exec_cmd("gsettings set org.gnome.desktop.interface gtk-theme \"Materia-dark\"") hl.exec_cmd("gsettings set org.gnome.desktop.interface color-scheme \"prefer-dark\"") + hl.exec_cmd("gsettings set org.gnome.desktop.interface cursor-theme \"ArchLogo\"") + hl.exec_cmd("gsettings set org.gnome.desktop.interface cursor-size 24") end)