{"id":18274578,"url":"https://github.com/ful1e5/clickgen","last_synced_at":"2025-10-07T10:51:25.509Z","repository":{"id":40430778,"uuid":"266319125","full_name":"ful1e5/clickgen","owner":"ful1e5","description":"The hassle-free cursor building toolbox.","archived":false,"fork":false,"pushed_at":"2024-05-21T17:03:58.000Z","size":3818,"stargazers_count":70,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-22T16:42:49.513Z","etag":null,"topics":["python","window-cursors","xcursor"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ful1e5.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ful1e5"}},"created_at":"2020-05-23T11:07:28.000Z","updated_at":"2024-06-05T11:12:59.880Z","dependencies_parsed_at":"2024-02-19T13:40:52.276Z","dependency_job_id":"6a109503-6c85-4b09-94cb-5535c94fdff5","html_url":"https://github.com/ful1e5/clickgen","commit_stats":{"total_commits":1368,"total_committers":6,"mean_commits":228.0,"dds":0.3399122807017544,"last_synced_commit":"6961e28e3d66ff26c0d85bfe4ad5ac423a6facc2"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ful1e5%2Fclickgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ful1e5%2Fclickgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ful1e5%2Fclickgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ful1e5%2Fclickgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ful1e5","download_url":"https://codeload.github.com/ful1e5/clickgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232340081,"owners_count":18508089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","window-cursors","xcursor"],"created_at":"2024-11-05T12:10:01.191Z","updated_at":"2025-10-07T10:51:20.469Z","avatar_url":"https://github.com/ful1e5.png","language":"Python","funding_links":["https://github.com/sponsors/ful1e5"],"categories":[],"sub_categories":[],"readme":"# Clickgen\n\n[![ci](https://github.com/ful1e5/clickgen/actions/workflows/ci.yml/badge.svg)](https://github.com/ful1e5/clickgen/actions/workflows/ci.yml)\n[![code coverage](https://codecov.io/gh/ful1e5/clickgen/branch/main/graph/badge.svg)](https://codecov.io/gh/ful1e5/clickgen)\n\nClickgen is cross-platform python library for building XCursor and Windows Cursors.\n\nClickgen's core functionality is heavily inspired by [quantum5/win2xcur](https://github.com/quantum5/win2xcur) from _v2.0.0_ and onwards.\n\n## Notices\n\n\u003c!-- If you're interested, you can learn more about 'sponsor-spotlight' on\n https://dev.to/ful1e5/lets-give-recognition-to-those-supporting-our-work-on-github-sponsors-b00 --\u003e\n\n![shoutout-sponsors](https://sponsor-spotlight.vercel.app/sponsor?login=ful1e5)\n\n\u003e **Note**\n\u003e The project's success depends on sponsorships. Meeting sponsorship goals for [ful1e5](https://github.com/ful1e5) GitHub Account will drive new releases and ongoing development.\n\n-   **2024-05-24:** Clickgen now allows cursor bitmap re-canvasing by specifying size using the `cursor_size:canvas_size` format. See [changelog-05212024](https://github.com/ful1e5/clickgen/discussions/59#discussioncomment-9511166)\n-   **2023-08-23:** `ctgen` CLI supports `.json` and `.yaml`/`.yml` as configuration file.\n-   **2023-08-17:** Cursor size settings moved to `[cursors.fallback_settings]` in config. See [changelog-08172023](https://github.com/ful1e5/clickgen/discussions/59#discussioncomment-6747666)\n-   **2022-06-15:** Docker Image support deprecated due to cross-platform compatibility.\n-   **2022-07-09:** :warning: All the **functionality and modules are removed from older versions in `v2.0.0`**.\n    I will be restricting any updates to the `\u003e=v1.2.0` versions to security updates and hotfixes.\n    Check updated documentations for [building cursors from API](#api-examples) and [CLIs](#usage) usage.\n\n## Requirements\n\n-   Python version 3.7.5 or higher\n-   [Pillow](https://pypi.org/project/Pillow) \u003e= 8.1.1\n-   [PyYaml](https://pypi.org/project/PyYaml) \u003e= 6.0.1\n-   [attrs](https://pypi.org/project/attrs) \u003e= 15.0.0\n-   [numpy](https://pypi.org/project/numpy) \u003e= 1.21.6\n-   [toml](https://pypi.org/project/toml) \u003e= 0.10.2\n\n## Install\n\n```bash\npip3 install clickgen\n```\n\n\u003e **Note**\n\u003e Distributions' packages are not affiliated with clickgen developers.\n\u003e If you encounter any issues with the incorrect installation, you should contact the package maintainer first.\n\n### Arch Linux\n\n-   [AUR](https://aur.archlinux.org/packages/python-clickgen)\n\n## Usage\n\n### `clickgen` CLI\n\n#### Linux Format (XCursor)\n\nFor example, if you have to build [ponter.png](https://github.com/ful1e5/clickgen/blob/main/samples/pngs/pointer.png)\nfile to Linux Format:\n\n```bash\nclickgen samples/pngs/pointer.png -x 10 -y 10 -s 22 24 32 -p x11\n```\n\nYou also **build animated Xcursor** by providing multiple png files to argument and animation delay with `-d`:\n\n```bash\nclickgen samples/pngs/wait-001.png samples/pngs/wait-001.png -d 3 -x 10 -y 10 -s 22 24 32 -p x11\n```\n\n#### Windows Formats (.cur and .ani)\n\nTo build [ponter.png](https://github.com/ful1e5/clickgen/blob/main/samples/pngs/pointer.png)\nfile to Windows Format (`.cur`):\n\n\u003e **Warning: Windows Animated Cursor only support single size.**\n\n```bash\nclickgen samples/pngs/pointer.png -x 10 -y 10 -s 32 -p windows\n```\n\nYou can also specify the size in the `size:canvas_size` format to enable canvasing:\n\n```bash\nclickgen samples/pngs/pointer.png -x 10 -y 10 -s 20:32 -p windows\n```\n\nFor **animated Windows Cursor** (`.ani`):\n\n```bash\nclickgen samples/pngs/wait-001.png samples/pngs/wait-001.png -d 3 -x 10 -y 10 -s 32 -p windows\n```\n\nFor more information, run `clickgen --help`.\n\n### `ctgen` CLI\n\nThis CLI allow you to generate Windows and Linux Cursor themes from config (.toml.yml,and .json) files.\n\n```bash\nctgen sample/sample.json\nctgen sample/sample.toml\nctgen sample/sample.yaml\n```\n\nYou also provide multiple theme configuration file once as following:\n\n```bash\nctgen sample/sample.toml sample/sample.json\n```\n\nOverride theme's `name` of theme with `-n` option:\n\n```bash\nctgen sample/sample.toml -n \"New Theme\"\n```\n\nYou can run `ctgen --help` to view all available options and you also check\n[samples](https://github.com/ful1e5/clickgen/blob/main/samples) directory for more information.\n\n### API Examples\n\n### Static `XCursor`\n\n```python\nfrom clickgen.parser import open_blob\nfrom clickgen.writer import to_x11\n\nwith open(\"samples/pngs/pointer.png\", \"rb\") as p:\n    cur = open_blob([p.read()], hotspot=(50, 50))\n\n    # save X11 static cursor\n    xresult = to_x11(cur.frames)\n    with open(\"xtest\", \"wb\") as o:\n        o.write(xresult)\n```\n\n### Animated `XCursor`\n\n```python\nfrom glob import glob\nfrom typing import List\n\nfrom clickgen.parser import open_blob\nfrom clickgen.writer import to_x11\n\n# Get .png files from directory\nfnames = glob(\"samples/pngs/wait-*.png\")\npngs: List[bytes] = []\n\n# Reading as bytes\nfor f in sorted(fnames):\n    with open(f, \"rb\") as p:\n        pngs.append(p.read())\n\ncur = open_blob(pngs, hotspot=(100, 100))\n\n# save X11 animated cursor\nresult = to_x11(cur.frames)\nwith open(\"animated-xtest\", \"wb\") as o:\n    o.write(result)\n```\n\n### Static `Windows Cursor` (.cur)\n\n```python\nfrom clickgen.parser import open_blob\nfrom clickgen.writer import to_win\n\nwith open(\"samples/pngs/pointer.png\", \"rb\") as p:\n    cur = open_blob([p.read()], hotspot=(50, 50))\n\n    # save Windows static cursor\n    ext, result = to_win(cur.frames)\n    with open(f\"test{ext}\", \"wb\") as o:\n        o.write(result)\n```\n\n### Animated `Windows Cursor` (.ani)\n\n```python\nfrom glob import glob\nfrom typing import List\n\nfrom clickgen.parser import open_blob\nfrom clickgen.writer import to_win\n\n# Get .png files from directory\nfnames = glob(\"samples/pngs/wait-*.png\")\npngs: List[bytes] = []\n\n# Reading as bytes\nfor f in sorted(fnames):\n    with open(f, \"rb\") as p:\n        pngs.append(p.read())\n\ncur = open_blob(pngs, hotspot=(100, 100))\n\n# save Windows animated cursor\next, result = to_win(cur.frames)\nwith open(f\"test-ani{ext}\", \"wb\") as o:\n    o.write(result)\n```\n\n### Documentation\n\nCheck [wiki](https://github.com/ful1e5/clickgen/wiki) for documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fful1e5%2Fclickgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fful1e5%2Fclickgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fful1e5%2Fclickgen/lists"}