Package: clickgen
ClickgenClickgen is cross-platform python library for building XCursor and Windows Cursors.Clickgen's core functionality is heavily inspired byquantum5/win2xcurfromv2.0.0and onwards.NoticesNoteThe project's success depends on sponsorships. Meeting sponsorship goals forful1e5GitHub Account will drive new releases and ongoing development.2023-08-23:ctgenCLI supports.jsonand.yaml/.ymlas configuration file.2023-08-17:Cursor size settings moved to[cursors.fallback_settings]in config. Seechangelog-081720232022-06-15:Docker Image support deprecated due to cross-platform compatibility.2022-07-09::warning: All thefunctionality and modules are removed from older versions inv2.0.0.
I will be restricting any updates to the>=v1.2.0versions to security updates and hotfixes.
Check updated documentations forbuilding cursors from APIandCLIsusage.RequirementsPython version 3.7.5 or higherPillow>= 8.1.1PyYaml>= 6.0.1attrs>= 15.0.0numpy>= 1.21.6toml>= 0.10.2Installpip3installclickgenNoteDistributions' packages are not affiliated with clickgen developers.
If you encounter any issues with the incorrect installation, you should contact the package maintainer first.Arch LinuxAURUsageclickgenCLILinux Format (XCursor)For example, if you have to buildponter.pngfile to Linux Format:clickgen samples/pngs/pointer.png -x 10 -y 10 -s 22 24 32 -p x11You alsobuild animated Xcursorby providing multiple png files to argument and animation delay with-d:clickgen samples/pngs/wait-001.png samples/pngs/wait-001.png -d 3 -x 10 -y 10 -s 22 24 32 -p x11Windows Formats (.cur and .ani)To buildponter.pngfile to Windows Format (.cur):Warning: Windows Cursor only support single size.clickgen samples/pngs/pointer.png -x 10 -y 10 -s 32 -p windowsForanimated Windows Cursor(.ani):clickgen samples/pngs/wait-001.png samples/pngs/wait-001.png -d 3 -x 10 -y 10 -s 32 -p windowsFor more information, runclickgen --help.ctgenCLIThis CLI allow you to generate Windows and Linux Cursor themes from config (.toml.yml,and .json) files.ctgensample/sample.json
ctgensample/sample.toml
ctgensample/sample.yamlYou also provide multiple theme configuration file once as following:ctgen sample/sample.toml sample/sample.jsonOverride theme'snameof theme with-noption:ctgen sample/sample.toml -n "New Theme"You can runctgen --helpto view all available options and you also checksamplesdirectory for more information.API ExamplesStaticXCursorfromclickgen.parserimportopen_blobfromclickgen.writerimportto_x11withopen("samples/pngs/pointer.png","rb")asp:cur=open_blob([p.read()],hotspot=(50,50))# save X11 static cursorxresult=to_x11(cur.frames)withopen("xtest","wb")aso:o.write(xresult)AnimatedXCursorfromglobimportglobfromtypingimportListfromclickgen.parserimportopen_blobfromclickgen.writerimportto_x11# Get .png files from directoryfnames=glob("samples/pngs/wait-*.png")pngs:List[bytes]=[]# Reading as bytesforfinsorted(fnames):withopen(f,"rb")asp:pngs.append(p.read())cur=open_blob(pngs,hotspot=(100,100))# save X11 animated cursorresult=to_x11(cur.frames)withopen("animated-xtest","wb")aso:o.write(result)StaticWindows Cursor(.cur)fromclickgen.parserimportopen_blobfromclickgen.writerimportto_winwithopen("samples/pngs/pointer.png","rb")asp:cur=open_blob([p.read()],hotspot=(50,50))# save Windows static cursorext,result=to_win(cur.frames)withopen(f"test{ext}","wb")aso:o.write(result)AnimatedWindows Cursor(.ani)fromglobimportglobfromtypingimportListfromclickgen.parserimportopen_blobfromclickgen.writerimportto_win# Get .png files from directoryfnames=glob("samples/pngs/wait-*.png")pngs:List[bytes]=[]# Reading as bytesforfinsorted(fnames):withopen(f,"rb")asp:pngs.append(p.read())cur=open_blob(pngs,hotspot=(100,100))# save Windows animated cursorext,result=to_win(cur.frames)withopen(f"test-ani{ext}","wb")aso:o.write(result)DocumentationCheckwikifor documentation.