Skip to content

Latest commit

 

History

History
154 lines (105 loc) · 3.3 KB

README.md

File metadata and controls

154 lines (105 loc) · 3.3 KB

clickgen

X11 & Windows cursor building API 👷

GitHub Action Build PyPI version CodeFactor


Clickgen

clickgen is API for building X11 and Windows Cursors from .png files. clickgen is using anicursorgen and xcursorgen under the hood.

Install

using pip

pip3 install clickgen

ArchLinux

yay -S python-clickgen

Manjaro

pamac build python-clickgen

CLI

clickgen -h

PyPi Dependencies

  • Pillow/python-pillow

Runtime Dependencies

  • libxcursor-dev
  • libx11-dev
  • libpng-dev (<=1.6)

Install Runtime Dependencies

macOS
brew cask install xquartz libpng
Debain/ubuntu
sudo apt install libx11-dev libxcursor-dev libpng-dev
ArchLinux/Manjaro
sudo pacman -S libx11 libxcursor libpng
Fedora/Fedora Silverblue/CentOS/RHEL
sudo dnf install libx11-devel libxcursor-devel libpng-devel

Examples

🔥 Check examples here

Recommended: Design Cursor bitmaps images(.png) in 200x200 pixel for HiDPI size support. Note: Provide cursor's hotspot respect to bitmaps, Clickgen's Linker automatically generate hotspots for each cursor_sizes. Check hotspots.json file for more info.

Generate Cursor's config files (.in)

import json
from clickgen import configsgen

with open('./hotspots.json', 'r') as hotspot_file:
    hotspots = json.loads(hotspot_file.read())

configsgen.generate_configs(
    imgs_dir="./bitmaps", cursor_sizes=[24, 28], out_dir="./configs", delay=50)

Build Cursor Theme

import json
from clickgen import build_cursor_theme

with open('./hotspots.json', 'r') as hotspot_file:
    hotspots = json.loads(hotspot_file.read())

build_cursor_theme(
    name="My Cursor", image_dir="./bitmaps", cursor_sizes=[24, 28], hotspots=hotspots, out_path="./themes", delay=50)

Build only x11 cursor theme

import json
from clickgen import build_x11_cursor_theme

with open('./hotspots.json', 'r') as hotspot_file:
    hotspots = json.loads(hotspot_file.read())

build_x11_cursor_theme(
    name="My Cursor", image_dir="./bitmaps", cursor_sizes=[24, 28], hotspots=hotspots, out_path="./themes", delay=50)

Build only Windows cursor theme

import json
from clickgen import build_win_cursor_theme

with open('./hotspots.json', 'r') as hotspot_file:
    hotspots = json.loads(hotspot_file.read())

build_win_cursor_theme(
    name="My Cursor", image_dir="./bitmaps", cursor_sizes=[24, 28], hotspots=hotspots, out_path="./themes", delay=50)