Skip to main content

X11 & Windows cursor building API 👷

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clickgen-1.1.7.tar.gz (31.0 kB view hashes)

Uploaded Source

Built Distribution

clickgen-1.1.7-py3-none-any.whl (29.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page