Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e99334472 | |||
| 32fbd3f29c | |||
| e1d1eb7eab | |||
| c79173e163 | |||
| ae4c83457b | |||
| 6a1a31c467 | |||
| 0612272479 | |||
| 0808b8b854 | |||
| b9541e7962 | |||
| ce77c65297 | |||
| 0e221e80e0 | |||
| f575f41f49 | |||
| 0125db0943 | |||
| d6453e44a1 | |||
| ff8f9feab9 | |||
| 08baf6bc73 | |||
| 75c26ae810 | |||
| 272d52bc3c | |||
| fa799336ae | |||
| 813b2da114 | |||
| 7e066433be | |||
| 4e93820ef6 | |||
| de7aa52a19 | |||
| bf002c209d | |||
| 5844450e1e | |||
| 4624118b20 | |||
| ffbd4fa4d9 | |||
| eb1716d157 | |||
| cb80d2d154 | |||
| 377bc9fe29 | |||
| d60f9e62d9 | |||
| da8bab3ff1 | |||
| d2dd5c4645 | |||
| cbb3d5e1c6 | |||
| ce23b3500c | |||
| b326ad3d39 | |||
| 2016a6b3dd | |||
| 523834881e | |||
| d639709b06 | |||
| 2af59cd5a5 | |||
| 865ae5ab24 | |||
| 0400eb07c2 | |||
| d1dff4d4a4 | |||
| b8acf148bb | |||
| 865cf7b1dd | |||
| c7ac3c9092 | |||
| 913271c7ab |
@@ -1,2 +1 @@
|
||||
patreon: KaizKhatri
|
||||
custom: https://www.paypal.me/kaizkhatri
|
||||
github: ful1e5
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 60
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: wontfix
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
@@ -4,86 +4,45 @@ on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "**.bbcode"
|
||||
- LICENSE
|
||||
- .github/FUNDING.yml
|
||||
branches: [main, dev]
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "**.bbcode"
|
||||
- LICENSE
|
||||
- .github/FUNDING.yml
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install build dependencies (apt)
|
||||
run: sudo apt install -y libx11-dev libxcursor-dev libpng-dev
|
||||
continue-on-error: false
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- name: Caching yarn packages
|
||||
uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Set Up NodeJS 12.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "12.x"
|
||||
- name: Caching pip packages
|
||||
uses: actions/cache@v2
|
||||
id: pip-cache # use this to check for `cache-hit` (`steps.pip-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Set up Python 3.8
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.8"
|
||||
- name: Generating `BreezeX` Cursor Theme
|
||||
run: make
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Installing pip dependencies
|
||||
run: python -m pip install --upgrade pip clickgen
|
||||
continue-on-error: false
|
||||
|
||||
- name: Compressing UNIX theme
|
||||
run: |
|
||||
tar -cvzf BreezeX-Dark.tar.gz themes/BreezeX-Dark
|
||||
tar -cvzf BreezeX-Light.tar.gz themes/BreezeX-Light
|
||||
# https://github.com/returntocorp/semgrep/issues/4794
|
||||
- name: Fixing 'attr' module error
|
||||
run: pip install --force-reinstall --upgrade attrs
|
||||
|
||||
- name: Uploading `bitmaps` artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: bitmaps
|
||||
path: bitmaps/*
|
||||
- name: Building `BreezeX Dark` Cursors
|
||||
run: ctgen build.toml -d 'bitmaps/BreezeX-Dark' -n 'BreezeX-Dark' -c 'BreezeX Dark cursors.'
|
||||
|
||||
- name: Uploading `BreezeX-Dark` UNIX Theme artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: BreezeX-Dark
|
||||
path: BreezeX-Dark.tar.gz
|
||||
- name: Building `BreezeX Light` Cursors
|
||||
run: ctgen build.toml -d 'bitmaps/BreezeX-Light' -n 'BreezeX-Light' -c 'BreezeX Light cursors.'
|
||||
|
||||
- name: Uploading `BreezeX-Light` UNIX Theme artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: BreezeX-Light
|
||||
path: BreezeX-Light.tar.gz
|
||||
|
||||
- name: Uploading `BreezeX-Dark` Windows Theme artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: BreezeX-Dark-Windows
|
||||
path: themes/BreezeX-Dark-Windows/*
|
||||
|
||||
- name: Uploading `BreezeX-Light` Windows Theme artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: BreezeX-Light-Windows
|
||||
path: themes/BreezeX-Light-Windows/*
|
||||
- name: Building `BreezeX Black` Cursors
|
||||
run: ctgen build.toml -d 'bitmaps/BreezeX-Black' -n 'BreezeX-Black' -c 'BreezeX Black cursors.'
|
||||
|
||||
@@ -1,142 +1,6 @@
|
||||
########## Custom
|
||||
bitmaps
|
||||
# Custom
|
||||
themes
|
||||
builder/files.txt
|
||||
|
||||
########## Python
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
pip-wheel-metadata/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
celerybeat-schedule
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
|
||||
######### Node
|
||||
bin
|
||||
|
||||
# Logs
|
||||
logs
|
||||
|
||||
@@ -7,6 +7,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [unreleased]
|
||||
|
||||
## [v2.0.0] - 14 October 2021
|
||||
|
||||
### What's New?
|
||||
|
||||
- Refactor: build with `clickgen v2` #21
|
||||
- Add cursor top_left_arrow #10 #11
|
||||
- Uninstall docs ful1e5/apple_cursor#79 ful1e5/apple_cursor#80
|
||||
- ci: support `clickgen v2` build with cross platform test
|
||||
|
||||
### Issue Fixes
|
||||
|
||||
- fixed #17
|
||||
- fixed #21
|
||||
- Human readable docs #16
|
||||
|
||||
## [v1.0.3] - 13 November 2021
|
||||
|
||||
### Added
|
||||
|
||||
- `Makefile` command with `THEME_PREFIX` variable
|
||||
- distributed pling products docs inside `pling` directory
|
||||
- `prepare` command added inside `Makefile`
|
||||
- upload `BreezeX-Black` artifacts in `build` GitHub Action
|
||||
|
||||
### Changed
|
||||
|
||||
- sponsor with liberapay
|
||||
- builder module renamed to `src`
|
||||
- bitmapping log more descriptive
|
||||
- minimal `README.md` (removed badges and emojis)
|
||||
|
||||
## [v1.0.2] - 20 June 2021
|
||||
|
||||
### Added
|
||||
|
||||
- **BreezeX-Black** variant added
|
||||
|
||||
### Changed
|
||||
|
||||
- Bigger hotspot dot for Resize cursors
|
||||
- Windows resize cursors scale down
|
||||
- `text` & `vertical-text` cursors scale down
|
||||
|
||||
## [v1.0.1] - 16 June 2021
|
||||
|
||||
### Changed
|
||||
|
||||
- `left_ptr_watch` and `wait` got minimal design
|
||||
- Cursors preview updated
|
||||
|
||||
## [v1.0.0] - 14 June 2021
|
||||
|
||||
### Added
|
||||
@@ -15,5 +65,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Logo and badges
|
||||
- CI/CD Pipelines
|
||||
|
||||
[unreleased]: https://github.com/ful1e5/BreezeX_Cursor/compare/v1.0.0...main
|
||||
[unreleased]: https://github.com/ful1e5/BreezeX_Cursor/compare/v2.0.0...main
|
||||
[v2.0.0]: https://github.com/ful1e5/BreezeX_Cursor/compare/v1.0.3...v2.0.0
|
||||
[v1.0.3]: https://github.com/ful1e5/BreezeX_Cursor/compare/v1.0.2...v1.0.3
|
||||
[v1.0.2]: https://github.com/ful1e5/BreezeX_Cursor/compare/v1.0.1...v1.0.2
|
||||
[v1.0.1]: https://github.com/ful1e5/BreezeX_Cursor/compare/v1.0.0...v1.0.1
|
||||
[v1.0.0]: https://github.com/ful1e5/BreezeX_Cursor/tree/v1.0.0
|
||||
|
||||
@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
Extended KDE Cursor
|
||||
Copyright (C) 2022 Abdulkaiz Khatri
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
BreezeX_Cursor Copyright (C) 2022 Abdulkaiz Khatri
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
all: clean render build
|
||||
|
||||
clean:
|
||||
@rm -rf bitmaps themes
|
||||
|
||||
render: bitmapper svg
|
||||
@cd bitmapper && $(MAKE)
|
||||
|
||||
build: bitmaps
|
||||
@cd builder && make build clean
|
||||
|
||||
.PHONY: all
|
||||
|
||||
unix: clean render bitmaps
|
||||
@cd builder && make build_unix clean
|
||||
|
||||
windows: clean render bitmaps
|
||||
@cd builder && make build_windows clean
|
||||
|
||||
|
||||
# Installation
|
||||
.ONESHELL:
|
||||
SHELL:=/bin/bash
|
||||
|
||||
src = ./themes/BreezeX-*
|
||||
local := ~/.icons
|
||||
local_dest := $(local)/BreezeX-*
|
||||
|
||||
root := /usr/share/icons
|
||||
root_dest := $(root)/BreezeX-*
|
||||
|
||||
install: themes
|
||||
@if [[ $EUID -ne 0 ]]; then
|
||||
@echo "> Installing 'BreezeX' cursors inside $(local)/..."
|
||||
@mkdir -p $(local)
|
||||
@cp -r $(src) $(local)/ && echo "> Installed!"
|
||||
@else
|
||||
@echo "> Installing 'BreezeX' cursors inside $(root)/..."
|
||||
@mkdir -p $(root)
|
||||
@sudo cp -r $(src) $(root)/ && echo "> Installed!"
|
||||
@fi
|
||||
|
||||
uninstall:
|
||||
@if [[ $EUID -ne 0 ]]; then
|
||||
@echo "> Removing 'BreezeX' cursors from '$(local)'..."
|
||||
@rm -rf $(local_dest)
|
||||
@else
|
||||
@echo "> Removing 'BreezeX' cursors from '$(root)'..."
|
||||
@sudo rm -rf $(root_dest)
|
||||
@fi
|
||||
|
||||
reinstall: uninstall install
|
||||
@@ -1,41 +0,0 @@
|
||||
[b]BreezeX [/b] Cursor Theme with [b]HiDPi[/b] Display support. This Cursor is built with [b][url=https://github.com/ful1e5/clickgen]clickgen[/url][/b] and render with the [b][url=https://github.com/puppeteer/puppeteer/]puppeteer[/url][/b].
|
||||
[i]Available Sizes[/i] [b]22, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96
|
||||
|
||||
[/b][i]Get latest build[/i] @[b][url=https://github.com/ful1e5/BreezeX_Cursor/actions]GitHub Actions[/url][/b]
|
||||
[i]Release Notification[/i] at [b][url=https://twitter.com/ful1e5]Twitter[/url][/b](@ful1e5)
|
||||
For [i]Customizing Size[/i] check [b][url=https://github.com/ful1e5/BreezeX_Cursor#manual-build]README.md[/url][/b]
|
||||
|
||||
[b]Linux/X11 installation[/b]
|
||||
Get the latest stable Linux release from the [b][url=https://www.pling.com/p/1538515/#files-panel]Pling[/url][/b]. Unpack [b].tar.gz[/b] file and follow these [b]commands[/b].
|
||||
|
||||
[b]Install[/b]
|
||||
[b]For all user:[/b]
|
||||
[code]sudo mv BreezeX-* /usr/share/icons[/code]
|
||||
[b]For local user:[/b]
|
||||
[code]mv BreezeX-* ~/.icons[/code]
|
||||
|
||||
[b]Uninstall[/b]
|
||||
[b]From all user:[/b]
|
||||
[code]sudo rm -r /usr/share/icons/BreezeX-*[/code]
|
||||
[b]From local user:[/b]
|
||||
[code]rm -r ~/.icons/BreezeX-*[/code]
|
||||
|
||||
[b]Window installation[/b]
|
||||
[list=1]
|
||||
[*]unzip [b].zip[/b] file[/*]
|
||||
[*]Open [b]unziped directory[/b] in Explorer, and [b]right-click[/b] on [b]install.inf[/b].[/*]
|
||||
[*]Click 'Install' from the context menu, and authorise the modifications to your system.[/*]
|
||||
[*]Open [i]Control Panel > Personalisation and Appearance > Change mouse pointers[/i], and select [b]BreezeX Cursors[/b].[/*]
|
||||
[*]Click '[b]Apply[/b]'.[/*]
|
||||
[/list]
|
||||
|
||||
[b]How I help the Creator?[/b]
|
||||
[list=2]
|
||||
[*]Give a [b]Star[/b] or [b]Follow[/b] on [b][url=https://github.com/ful1e5/BreezeX_Cursor]GitHub[/url][/b] (issues & PullRequest are welcome).[/*]
|
||||
[*]By giving a [b]Pling[/b] or [b][url=https://www.paypal.me/kaizkhatri]Donation[/url][/b].[/*]
|
||||
[*][b]Download[/b] from[url=https://www.pling.com/p/1538515/#files-panel] Pling.com[/url] Product page that helps to [b]increases[/b] my [b]monthly payout[/b].[/*]
|
||||
[*][b][url=https://www.pling.com/support]Become Supporter of Pling.com[/url][/b], So we become [b]Full-Time [/b]Libre & FOSS content creator [b];)[/b][/*]
|
||||
[/list]
|
||||
|
||||
[b]License & Terms[/b]
|
||||
'[b]BreezeX[/b]' Cursor Theme is available under the terms of the [b]GPL-3.0[/b] license.
|
||||
@@ -1,77 +1,39 @@
|
||||
<p align="center">
|
||||
<img src="https://imgur.com/5M6xQZx.png" width="120" alt="BreezeX" />
|
||||
</p>
|
||||
# BreezeX Cursor
|
||||
|
||||
<p align="center">
|
||||
extended KDE cursor 💙
|
||||
</p>
|
||||
Extended KDE cursor, Highly inspired on **KDE Breeze** for `Windows` and `Linux` with _HiDPi Support_ .
|
||||
|
||||
<!-- Badges -->
|
||||
<p align="center">
|
||||
<!-- First Row -->
|
||||
<a href="https://github.com/ful1e5/BreezeX_Cursor/actions">
|
||||
<img alt="GitHub Action Build" src="https://github.com/ful1e5/BreezeX_Cursor/actions/workflows/build.yml/badge.svg" width="102" />
|
||||
</a>
|
||||
[](https://github.com/ful1e5/BreezeX_Cursor/actions/workflows/build.yml)
|
||||
|
||||
<a href="https://www.codefactor.io/repository/github/ful1e5/breezex_cursor">
|
||||
<img src="https://www.codefactor.io/repository/github/ful1e5/breezex_cursor/badge" alt="CodeFactor" />
|
||||
</a>
|
||||
## BreezeX needs your Input
|
||||
|
||||
<!-- Second Row -->
|
||||
</br >
|
||||
<a href="https://www.typescriptlang.org/docs/handbook/typescript-from-scratch.html">
|
||||
<img alt="npm type definitions" src="https://img.shields.io/npm/types/typescript">
|
||||
</a>
|
||||
Until 2021 my cursors projects were well funded by [pling.com](https://www.pling.com) but since the
|
||||
[pling-factor](https://www.pling.com/terms/payout) on the website has decreased and monthly payments
|
||||
are <500$, It is now dependent on community funding and sponsorships. If you want to help me to maintain
|
||||
BreezeX and my other open source projects actively, consider sponsoring my work on [GitHub Sponsor](https://github.com/sponsors/ful1e5)
|
||||
or DM me on [Twitter](https://twitter.com/ful1e5) if your company would like to support my projects,
|
||||
I will gladly look into it and post your avatar in the project's README.
|
||||
|
||||
<a href="https://github.com/puppeteer/puppeteer/">
|
||||
<img alt="Puppeteer version" src="https://img.shields.io/github/package-json/dependency-version/ful1e5/BreezeX_Cursor/puppeteer?filename=bitmapper%2Fpackage.json">
|
||||
</a>
|
||||
I appreciate all the wonderful people who patronize and sponsoring my work.
|
||||
|
||||
<a href="https://github.com/ful1e5/clickgen">
|
||||
<img alt="Clickgen" src="https://img.shields.io/badge/theme%20builder-clickgen-FD0542" />
|
||||
</a>
|
||||
## Sponsors
|
||||
|
||||
<!-- Second Row -->
|
||||
<br />
|
||||
<a href="https://github.com/ful1e5/BreezeX_Cursor/releases">
|
||||
<img alt="BreezeX Cursor release (latest by date including pre-releases)" src="https://img.shields.io/github/v/release/ful1e5/BreezeX_Cursor?include_prer">
|
||||
</a>
|
||||
<!-- Add your name or avatar here with the Pull Request in case I missed it. -->
|
||||
|
||||
<a href="https://github.com/ful1e5/BreezeX_Cursor/blob/main/LICENSE">
|
||||
<img alt="License" src="https://img.shields.io/github/license/ful1e5/BreezeX_Cursor?color=0081FB" />
|
||||
</a>
|
||||
|
||||
<!-- Third Row -->
|
||||
|
||||
<br />
|
||||
<a href="https://www.pling.com/p/1538515/#files-panel">
|
||||
<img alt="License" src="https://img.shields.io/badge/-Linux-grey?logo=linux" />
|
||||
</a>
|
||||
|
||||
<a href="https://www.pling.com/p/1538515/#files-panel">
|
||||
<img alt="License" src="https://img.shields.io/badge/-Windows-blue?logo=windows" />
|
||||
</a>
|
||||
|
||||
<a href="https://www.python.org/">
|
||||
<img alt="License" src="https://img.shields.io/badge/-Python-yellow?logo=python" />
|
||||
</a>
|
||||
|
||||
<!-- Fourth Row -->
|
||||
<br />
|
||||
<a href="https://github.com/ful1e5">
|
||||
<img alt="Made By Kaiz" src="https://kaiz.vercel.app/api/badge" width="133" />
|
||||
</a>
|
||||
</p>
|
||||
N/A
|
||||
|
||||
---
|
||||
|
||||
<!-- Intro -->
|
||||

|
||||

|
||||

|
||||
|
||||
# BreezeX Cursor
|
||||
> **Note**
|
||||
> All cursor's `.svg` files are found in [svg](./svg) directory or you can also find them on
|
||||
> [Figma](https://www.figma.com/file/Uo4LeHvFUPDgoqLjnFc1LB/BreezeX?node-id=0%3A1).
|
||||
|
||||
Extended KDE Cursor theme, Highly inspired on **KDE Breeze** for `Windows` and `Linux` with _HiDPi Support_ 🎉.
|
||||
## Cursor Sizes
|
||||
|
||||
#### Cursor Sizes
|
||||
### Xcursor Sizes:
|
||||
|
||||
<kbd>22</kbd>
|
||||
<kbd>24</kbd>
|
||||
@@ -86,219 +48,240 @@ Extended KDE Cursor theme, Highly inspired on **KDE Breeze** for `Windows` and `
|
||||
<kbd>88</kbd>
|
||||
<kbd>96</kbd>
|
||||
|
||||
#### Colors
|
||||
### Windows Cursor Size:
|
||||
|
||||

|
||||

|
||||
- <kbd>16x16</kbd> - Small
|
||||
- <kbd>24x24</kbd> - Regular
|
||||
- <kbd>32x32</kbd> - Large
|
||||
- <kbd>48x48</kbd> - Extra Large
|
||||
|
||||
#### Quick install
|
||||
## Colors:
|
||||
|
||||
<!-- Quick install -->
|
||||
### BreezeX Dark
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.pling.com/p/1538515/#files-panel" >
|
||||
<img title="BreezeX Pling Store" width="40%" src="https://imgur.com/VxSgrWw.png">
|
||||
</a>
|
||||
</p>
|
||||
- Base Color - `#4D4D4D` (Breeze)
|
||||
- Outline Color - `#FFFFFF` (White)
|
||||
|
||||
#### Preview:
|
||||
### BreezeX Light
|
||||
|
||||
> Check Figma file [here](https://www.figma.com/file/Uo4LeHvFUPDgoqLjnFc1LB/BreezeX?node-id=0%3A1)
|
||||
- Base Color - `#FFFFFF` (White)
|
||||
- Outline Color - `#4D4D4D` (Breeze)
|
||||
|
||||
<!-- Preview -->
|
||||
### BreezeX Dark
|
||||
|
||||
<p align="center">
|
||||
<img title="BreezeX Dark" src="https://imgur.com/W2YNFuw.png">
|
||||
</br>
|
||||
<sub>Dark BreezeX Cursors 🖤</sub>
|
||||
</p>
|
||||
- Base Color - `#000000` (Black)
|
||||
- Outline Color - `#FFFFFF` (White)
|
||||
|
||||
<p align="center">
|
||||
<img title="BreezeX Light" src="https://imgur.com/25wSDfa.png">
|
||||
</br>
|
||||
<sub>Light BreezeX Cursors 🤍</sub>
|
||||
</p>
|
||||
## How to get it
|
||||
|
||||
### Manual Install
|
||||
### Easiest Way
|
||||
|
||||
You can download latest `stable` & `development` releases from
|
||||
[Release Page](https://github.com/ful1e5/BreezeX_Cursor/releases).
|
||||
|
||||
## Installing BreezeX Cursor
|
||||
|
||||
#### Linux/X11
|
||||
|
||||
**Installation:**
|
||||
|
||||
```bash
|
||||
# extract `BreezeX.tar.gz`
|
||||
tar -xvf BreezeX.tar.gz
|
||||
tar -xvf BreezeX-Dark.tar.gz # extract `BreezeX-Dark.tar.gz`
|
||||
mv BreezeX-* ~/.icons/ # Install to local users
|
||||
sudo mv BreezeX-* /usr/share/icons/ # Install to all users
|
||||
```
|
||||
|
||||
# For local users
|
||||
mv BreezeX-* ~/.icons/
|
||||
**Uninstallation:**
|
||||
|
||||
# For all users
|
||||
sudo mv BreezeX-* /usr/share/icons/
|
||||
```bash
|
||||
rm ~/.icons/BreezeX-* # Remove from local users
|
||||
sudo rm /usr/share/icons/BreezeX-* # Remove from all users
|
||||
```
|
||||
|
||||
#### Windows
|
||||
|
||||
1. unzip `.zip` file
|
||||
2. Open unzipped directory in Explorer, and **right click** on `install.inf`.
|
||||
**Installation:**
|
||||
|
||||
1. Unzip `.zip` file
|
||||
2. Open unziped directory in Explorer, and **right click** on `install.inf`.
|
||||
3. Click 'Install' from the context menu, and authorize the modifications to your system.
|
||||
4. Open _Control Panel > Personalization and Appearance > Change mouse pointers_, and select **BreezeX Cursors**.
|
||||
4. Open Control Panel > Personalization and Appearance > Change mouse pointers,
|
||||
and select **BreezeX Cursors**.
|
||||
5. Click '**Apply**'.
|
||||
|
||||
<!-- Build Dependencies -->
|
||||
**Uninstallation:**
|
||||
|
||||
# Dependencies
|
||||
Run the `uninstall.bat` script packed with the `.zip` archive
|
||||
|
||||
## External Libraries
|
||||
**OR** follow these steps:
|
||||
|
||||
- libxcursor
|
||||
- libx11
|
||||
- libpng (<=1.6)
|
||||
1. Go to **Registry Editor** by typing the same in the _start search box_.
|
||||
2. Expand `HKEY_CURRENT_USER` folder and expand `Control Panel` folder.
|
||||
3. Go to `Cursors` folder and click on `Schemes` folder - all the available custom cursors that are
|
||||
installed will be listed here.
|
||||
4. **Right Click** on the name of cursor file you want to uninstall; for eg.: _BreezeX Cursors_ and
|
||||
click `Delete`.
|
||||
5. Click '**yes**' when prompted.
|
||||
|
||||
#### Install External Libraries
|
||||
## Build From Source
|
||||
|
||||
##### ~macOS~ **[WIP]**
|
||||
#### Notes
|
||||
|
||||
- BreezeX build configuration and cursor hotspot settings are bundled in the `build.toml` file.
|
||||
- Check out the scripts section in [package.json](./package.json) to see how we build the cursor theme,
|
||||
excluding the render scripts. They are useful for converting `.svg` files to `.png` files.
|
||||
- yarn is optional, For building XCursors and Windows cursors from `.png` files or resizing them
|
||||
you don't need that. If you want to develop/modify BreezeX's colors, and bitmaps, or generate a png
|
||||
file from a svg, Then you can use yarn because bitmapper is written in TypeScript.
|
||||
- Since BreezeX variants are designed similarly, they share the same hotspot settings so a
|
||||
single configuration file `build.toml` is responsible for building all variants. Due to this, you will have
|
||||
to change the following options in `ctgen` to build the appropriate variant:
|
||||
- **-d**: bitmaps directory
|
||||
- **-n**: The name you want to give to the generated theme.
|
||||
- **-c**: Theme comment.
|
||||
- See `ctgen --help` for all available options.
|
||||
|
||||
### Build prerequisites
|
||||
|
||||
- Python version 3.7 or higher
|
||||
- [clickgen](https://github.com/ful1e5/clickgen)>=2.1.2 (`pip install clickgen`)
|
||||
- [yarn](https://github.com/yarnpkg/yarn)
|
||||
|
||||
### Quick start
|
||||
|
||||
1. Install [build prerequisites](#build-prerequisites) on your system
|
||||
2. `git clone https://github.com/ful1e5/BreezeX_Cursor`
|
||||
3. `cd BreezeX_Cursor && yarn build`
|
||||
4. See [Installing BreezeX Cursor](#installing-breezex-cursor).
|
||||
|
||||
### Building
|
||||
|
||||
> **Note**
|
||||
> Bitmaps are already generated in the `bitmaps` directory and **managed by the maintainer**
|
||||
> (do not edit them directly).
|
||||
|
||||
First make sure you installed the [build prerequisites](#build-prerequisites).
|
||||
Now that you have the dependencies, you can try build individual themes from bitmaps and
|
||||
customize sizes, target platform, and etc. with the `ctgen` CLI (packed with `clickgen`).
|
||||
|
||||
#### `yarn build` aberration
|
||||
|
||||
Here are the default commands we used to build the BreezeX's variants and packed them into `yarn build`:
|
||||
|
||||
```bash
|
||||
brew install --cask xquartz
|
||||
brew install libpng
|
||||
ctgen build.toml -d 'bitmaps/BreezeX-Dark' -n 'BreezeX-Dark' -c 'BreezeX Dark cursors.'
|
||||
ctgen build.toml -d 'bitmaps/BreezeX-Light' -n 'BreezeX-Light' -c 'BreezeX Light cursors.'
|
||||
ctgen build.toml -d 'bitmaps/BreezeX-Black' -n 'BreezeX-Black' -c 'BreezeX Black cursors.'
|
||||
```
|
||||
|
||||
##### Debain/ubuntu
|
||||
Afterwards, the themes can be found in the `themes` directory.
|
||||
|
||||
#### Customize Sizes
|
||||
|
||||
> **Note**
|
||||
> You can change the cursor size up to 200 because pngs are rendered with 200x200.
|
||||
> If the cursor is resized by more than rendered png size, the final cursor will be blurred.
|
||||
|
||||
##### Customize Windows Cursor size
|
||||
|
||||
To build Windows cursor with size `16`:
|
||||
|
||||
> **Warning**
|
||||
> Windows cursor supports only one size, if multiple sizes are given with `-s` the first size will
|
||||
> be considered in build.
|
||||
|
||||
```bash
|
||||
sudo apt install libx11-dev libxcursor-dev libpng-dev
|
||||
ctgen build.toml -s 16 -p windows -d 'bitmaps/BreezeX-Light' -n 'BreezeX-Light' -c 'White BreezeX cusors with size 16'
|
||||
```
|
||||
|
||||
##### ArchLinux/Manjaro
|
||||
You can also customize output directory with `-o` option:
|
||||
|
||||
```bash
|
||||
sudo pacman -S libx11 libxcursor libpng
|
||||
ctgen build.toml -s 16 -p windows -d 'bitmaps/BreezeX-Light' -o 'out' -n 'BreezeX-Light' -c 'White BreezeX cusors with size 16'
|
||||
```
|
||||
|
||||
##### Fedora/Fedora Silverblue/CentOS/RHEL
|
||||
##### Customize XCursor size
|
||||
|
||||
To build XCursor with size `16`:
|
||||
|
||||
```bash
|
||||
sudo dnf install libX11-devel libXcursor-devel libpng-devel
|
||||
ctgen build.toml -s 16 -p x11 -d 'bitmaps/BreezeX-Light' -n 'BreezeX-Light' -c 'White BreezeX cusors with size 16'
|
||||
```
|
||||
|
||||
## Build Dependencies
|
||||
|
||||
- [gcc](https://gcc.gnu.org/install/)
|
||||
- [make](https://www.gnu.org/software/make/)
|
||||
- [nodejs](https://nodejs.org/en/) (<=12.x.x)
|
||||
- [yarn](https://classic.yarnpkg.com/en/docs/install/)
|
||||
- [python](https://www.python.org/downloads/) (<=3.8)
|
||||
- [pip3](https://pip.pypa.io/en/stable/installing/)
|
||||
|
||||
### Node Packages
|
||||
|
||||
- [puppeteer](https://www.npmjs.com/package/puppeteer)
|
||||
- [pngjs](https://www.npmjs.com/package/pngjs)
|
||||
- [pixelmatch](https://www.npmjs.com/package/pixelmatch)
|
||||
|
||||
### PyPi Packages
|
||||
|
||||
- [clickgen](https://pypi.org/project/clickgen/s)
|
||||
|
||||
## Build Dependencies
|
||||
|
||||
- [gcc](https://gcc.gnu.org/install/)
|
||||
- [make](https://www.gnu.org/software/make/)
|
||||
- [nodejs](https://nodejs.org/en/) (<=12.x.x)
|
||||
- [yarn](https://classic.yarnpkg.com/en/docs/install/)
|
||||
- [python](https://www.python.org/downloads/) (<=3.8)
|
||||
- [pip3](https://pip.pypa.io/en/stable/installing/)
|
||||
|
||||
### Node Packages
|
||||
|
||||
- [puppeteer](https://www.npmjs.com/package/puppeteer)
|
||||
- [pngjs](https://www.npmjs.com/package/pngjs)
|
||||
- [pixelmatch](https://www.npmjs.com/package/pixelmatch)
|
||||
|
||||
### PyPi Packages
|
||||
|
||||
- [clickgen](https://pypi.org/project/clickgen/s)
|
||||
|
||||
## Build From Scratch
|
||||
|
||||
### ⚡ Auto Build (using GitHub Actions)
|
||||
|
||||
GitHub Actions is automatically runs on every `push`(on **main** and **dev** branches) and `pull request`(on **main** branch), You found theme resources in `artifact` section of **build**.GitHub **Actions** available inside [.github/workflows](https://github.com/ful1e5/BreezeX_Cursor/tree/main/.github/workflows) directory.
|
||||
|
||||
### Manual Build
|
||||
You can also assign multiple sizes to `ctgen` for XCursors build:
|
||||
|
||||
```bash
|
||||
make
|
||||
ctgen build.toml -s 16 24 32 -p x11 -d 'bitmaps/BreezeX-Light' -n 'BreezeX-Light' -c 'White BreezeX cusors with size 16'
|
||||
```
|
||||
|
||||
#### Build `XCursor` theme
|
||||
#### Customize Colors
|
||||
|
||||
To customize BreezeX's color you have to install node dependencies with `yarn install` command.
|
||||
After installing dependencies you can customize the colors via `npx cbmp` Node CLI App which packed with
|
||||
[cbmp](https://github.com/ful1e5/cbmp) node package.
|
||||
|
||||
##### `yarn render` aberration
|
||||
|
||||
Here are the default commands we used for generating the BreezeX's bitmaps and packed them into `yarn render`:
|
||||
|
||||
```bash
|
||||
make unix
|
||||
npx cbmp -d 'svg' -n 'BreezeX-Dark' -bc '#4D4D4D' -oc '#FFFFFF'
|
||||
npx cbmp -d 'svg' -n 'BreezeX-Light' -bc '#FFFFFF' -oc '#4D4D4D'
|
||||
npx cbmp -d 'svg' -n 'BreezeX-Black' -bc '#000000' -oc '#FFFFFF'
|
||||
```
|
||||
|
||||
#### Customize `XCursor` size
|
||||
#### Examples
|
||||
|
||||
Lets generate modern BreezeX with green base color and black outline:
|
||||
|
||||
```bash
|
||||
make unix X_SIZES=22 # Only built '22px' pixel-size.
|
||||
make unix X_SIZES=22 24 32 # Multiple sizes are provided with ' '(Space)
|
||||
npx cbmp -d 'svg' -n 'BreezeX-Hacker' -bc '#00FE00' -oc '#000000'
|
||||
```
|
||||
|
||||
#### Install `XCursor` theme
|
||||
After rendering custom color you have to build cursor through `ctgen`:
|
||||
|
||||
```bash
|
||||
make install # install as user
|
||||
# OR
|
||||
sudo make install # install as root
|
||||
ctgen build.toml -d 'bitmaps/BreezeX-Hacker' -n 'BreezeX-Hacker' -c 'Green and black BreezeX cursors.'
|
||||
```
|
||||
|
||||
#### Build `Windows` theme
|
||||
Afterwards, Generated theme can be found in the `themes` directory.
|
||||
|
||||
###### BreezeX Gruvbox
|
||||
|
||||
```bash
|
||||
make windows
|
||||
npx cbmp -d 'svg' -n 'BreezeX-Gruvbox' -bc '#282828' -oc '#EBDBB2'
|
||||
ctgen build.toml -d 'bitmaps/BreezeX-Gruvbox' -n 'BreezeX-Gruvbox' -c 'Groovy BreezeX cursors.'
|
||||
```
|
||||
|
||||
#### Customize `Windows Cursor` size
|
||||
###### BreezeX Solarized Dark
|
||||
|
||||
```bash
|
||||
make windows WIN_SIZE=96 # Supports only one pixel-size
|
||||
npx cbmp -d 'svg' -n 'BreezeX-Solarized-Dark' -bc '#002b36' -oc '#839496'
|
||||
ctgen build.toml -d 'bitmaps/BreezeX-Solarized-Dark' -n 'BreezeX-Solarized-Dark' -c 'Solarized Dark BreezeX cursors.'
|
||||
```
|
||||
|
||||
> For installation follow [these](#windows) steps.
|
||||
###### BreezeX Solarized Light
|
||||
|
||||
<!-- Bug Report -->
|
||||
```bash
|
||||
npx cbmp -d 'svg' -n 'BreezeX-Solarized-Light' -bc '#839496' -oc '#002b36'
|
||||
ctgen build.toml -d 'bitmaps/BreezeX-Solarized-Light' -n 'BreezeX-Solarized-Light' -c 'Solarized Light BreezeX cursors.'
|
||||
```
|
||||
|
||||
# Bugs
|
||||
###### BreezeX Dracula
|
||||
|
||||
Bugs 🐛 should be reported [here](https://github.com/ful1e5/BreezeX_Cursor/issues) on the Github issues page.
|
||||
```bash
|
||||
npx cbmp -d 'svg' -n 'BreezeX-Dracula' -bc '#282a36' -oc '#f8f8f2'
|
||||
ctgen build.toml -d 'bitmaps/BreezeX-Dracula' -n 'BreezeX-Dracula' -c 'Dracula BreezeX cursors.'
|
||||
```
|
||||
|
||||
<!-- Help -->
|
||||
## Bugs
|
||||
|
||||
# Getting Help
|
||||
Bugs should be reported [here](https://github.com/ful1e5/BreezeX_Cursor/issues) on the Github issues page.
|
||||
|
||||
You can create a **issue**, I will help you. 🙂
|
||||
## Getting Help
|
||||
|
||||
<!-- Contributions and Suggestion -->
|
||||
You can create a **issue**, I will help you.
|
||||
|
||||
# Contributing
|
||||
## Contributing
|
||||
|
||||
Check [CONTRIBUTING.md](CONTRIBUTING.md), any suggestions for features and contributions to the continuing code masterelopment can be made via the issue tracker or code contributions via a `Fork` & `Pull requests`.
|
||||
|
||||
<!-- Support -->
|
||||
|
||||
## Support
|
||||
|
||||
Give a **★** or Follow on [GitHub](https://github.com/ful1e5),That's work as **Steroid 💉** for me. 😉
|
||||
|
||||
> For extra support
|
||||
|
||||
<a href="https://www.buymeacoffee.com/Nt7Wg4V" target="_blank">
|
||||
<img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" >
|
||||
</a>
|
||||
|
||||
<!-- Ninja -->
|
||||
|
||||
<h1 align="center">
|
||||
( `ω´ )۶▬ι═══════ﺤ
|
||||
</h1>
|
||||
<p align="center">
|
||||
<sub>I'm Using Katana</sub>
|
||||
</p>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
all: install render
|
||||
|
||||
.PHONY: all
|
||||
|
||||
install: node_modules package.json
|
||||
@yarn install
|
||||
|
||||
render:
|
||||
@yarn render
|
||||
|
||||
watch:
|
||||
@yarn watch
|
||||
|
||||
node_modules:
|
||||
@mkdir -p $@
|
||||
|
||||
clean:
|
||||
@rm -rf node_modules yarn.lock
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"name": "breezex-bitmapper",
|
||||
"version": "1.0.0",
|
||||
"description": "extended KDE cursor 💙",
|
||||
"main": "index.js",
|
||||
"repository": "git@github.com:ful1e5/BreezeX_Cursor.git",
|
||||
"author": "Kaiz Khatri",
|
||||
"license": "GPL-3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"render": "npx ts-node src/index.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/pixelmatch": "^5.2.2",
|
||||
"@types/pngjs": "^3.4.2",
|
||||
"@types/puppeteer": "^5.4.2",
|
||||
"nodemon": "^2.0.7",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.1.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"pixelmatch": "^5.2.1",
|
||||
"pngjs": "^6.0.0",
|
||||
"puppeteer": "^5.5.0"
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
import { Colors } from "./core/types";
|
||||
|
||||
interface Config {
|
||||
themeName: string;
|
||||
color: Colors;
|
||||
}
|
||||
|
||||
const breezeColor = "#4D4D4D";
|
||||
const whiteColor = "#FFFFFF";
|
||||
|
||||
const config: Config[] = [
|
||||
{
|
||||
themeName: "BreezeX-Dark",
|
||||
color: {
|
||||
base: breezeColor,
|
||||
outline: whiteColor,
|
||||
},
|
||||
},
|
||||
{
|
||||
themeName: "BreezeX-Light",
|
||||
color: {
|
||||
base: whiteColor,
|
||||
outline: breezeColor,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export { config };
|
||||
@@ -1,155 +0,0 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
import puppeteer, { Browser, ElementHandle, Page } from "puppeteer";
|
||||
|
||||
import { frameNumber } from "./util/frameNumber";
|
||||
import { matchImages } from "./util/matchImages";
|
||||
import { toHTML } from "./util/toHTML";
|
||||
|
||||
class BitmapsGenerator {
|
||||
/**
|
||||
* Generate Png files from svg code.
|
||||
* @param themeName Give name, So all bitmaps files are organized in one directory.
|
||||
* @param bitmapsDir `absolute` or `relative` path, Where `.png` files will store.
|
||||
*/
|
||||
constructor(private bitmapsDir: string) {
|
||||
this.bitmapsDir = path.resolve(bitmapsDir);
|
||||
this.createDir(this.bitmapsDir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create directory if it doesn't exists.
|
||||
* @param dirPath directory `absolute` path.
|
||||
*/
|
||||
private createDir(dirPath: string) {
|
||||
if (!fs.existsSync(dirPath)) {
|
||||
fs.mkdirSync(dirPath, { recursive: true });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare headless browser.
|
||||
*/
|
||||
public async getBrowser(): Promise<Browser> {
|
||||
return await puppeteer.launch({
|
||||
ignoreDefaultArgs: ["--no-sandbox"],
|
||||
headless: true,
|
||||
});
|
||||
}
|
||||
|
||||
private async getSvgElement(
|
||||
page: Page,
|
||||
content: string
|
||||
): Promise<ElementHandle<Element>> {
|
||||
if (!content) {
|
||||
throw new Error(`${content} File Read error`);
|
||||
}
|
||||
|
||||
const html = toHTML(content);
|
||||
await page.setContent(html, { timeout: 0 });
|
||||
|
||||
const svg = await page.$("#container svg");
|
||||
|
||||
if (!svg) {
|
||||
throw new Error("svg element not found!");
|
||||
}
|
||||
return svg;
|
||||
}
|
||||
|
||||
public async generateStatic(browser: Browser, content: string, key: string) {
|
||||
const page = await browser.newPage();
|
||||
const svg = await this.getSvgElement(page, content);
|
||||
|
||||
const out = path.resolve(this.bitmapsDir, `${key}.png`);
|
||||
|
||||
await svg.screenshot({ omitBackground: true, path: out });
|
||||
await page.close();
|
||||
}
|
||||
|
||||
private async screenshot(
|
||||
element: ElementHandle<Element>
|
||||
): Promise<Buffer | string> {
|
||||
const buffer = await element.screenshot({
|
||||
encoding: "binary",
|
||||
omitBackground: true,
|
||||
});
|
||||
|
||||
if (!buffer) {
|
||||
throw new Error("SVG element screenshot not working");
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
private async stopAnimation(page: Page) {
|
||||
const client = await page.target().createCDPSession();
|
||||
await client.send("Animation.setPlaybackRate", {
|
||||
playbackRate: 0,
|
||||
});
|
||||
}
|
||||
|
||||
private async resumeAnimation(page: Page, playbackRate: number) {
|
||||
const client = await page.target().createCDPSession();
|
||||
await client.send("Animation.setPlaybackRate", {
|
||||
playbackRate,
|
||||
});
|
||||
}
|
||||
|
||||
private async saveFrameImage(key: string, frame: Buffer | string) {
|
||||
const out_path = path.resolve(this.bitmapsDir, key);
|
||||
fs.writeFileSync(out_path, frame);
|
||||
}
|
||||
|
||||
public async generateAnimated(
|
||||
browser: Browser,
|
||||
content: string,
|
||||
key: string,
|
||||
options?: {
|
||||
playbackRate?: number;
|
||||
diff?: number;
|
||||
frameLimit?: number;
|
||||
framePadding?: number;
|
||||
}
|
||||
) {
|
||||
const opt = Object.assign(
|
||||
{ playbackRate: 0.1, diff: 0, frameLimit: 300, framePadding: 4 },
|
||||
options
|
||||
);
|
||||
|
||||
const page = await browser.newPage();
|
||||
const svg = await this.getSvgElement(page, content);
|
||||
await this.stopAnimation(page);
|
||||
|
||||
let index = 1;
|
||||
let breakRendering = false;
|
||||
let prevImg: Buffer | string;
|
||||
|
||||
// Rendering frames till `imgN` matched to `imgN-1` (When Animation is done)
|
||||
while (!breakRendering) {
|
||||
if (index > opt.frameLimit) {
|
||||
throw new Error("Reached the frame limit.");
|
||||
}
|
||||
|
||||
await this.resumeAnimation(page, opt.playbackRate);
|
||||
const img: string | Buffer = await this.screenshot(svg);
|
||||
await this.stopAnimation(page);
|
||||
|
||||
if (index > 1) {
|
||||
// @ts-ignore
|
||||
const diff = matchImages(prevImg, img);
|
||||
if (diff <= opt.diff) {
|
||||
breakRendering = !breakRendering;
|
||||
}
|
||||
}
|
||||
const number = frameNumber(index, opt.framePadding);
|
||||
const frame = `${key}-${number}.png`;
|
||||
|
||||
this.saveFrameImage(frame, img);
|
||||
|
||||
prevImg = img;
|
||||
++index;
|
||||
}
|
||||
await page.close();
|
||||
}
|
||||
}
|
||||
export { BitmapsGenerator };
|
||||
@@ -1,77 +0,0 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
interface Svg {
|
||||
key: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
class SvgDirectoryParser {
|
||||
/**
|
||||
* Manage and Parse SVG file path in `absolute` fashion.
|
||||
* This Parser look svg files as below fashion:
|
||||
* `
|
||||
* <@svgDir>/static
|
||||
* <@svgDir>/animated
|
||||
* `
|
||||
* @param svgDir is relative/absolute path, Where `SVG` files are stored.
|
||||
*/
|
||||
semiAnimated: boolean = false;
|
||||
constructor(private svgDir: string) {
|
||||
if (!fs.existsSync(this.svgDir)) {
|
||||
throw new Error(`SVG files not found in ${this.svgDir}`);
|
||||
}
|
||||
}
|
||||
|
||||
private readData(f: string): Svg {
|
||||
const content = fs.readFileSync(f, "utf-8");
|
||||
const key = path.basename(f, ".svg");
|
||||
return { content, key };
|
||||
}
|
||||
|
||||
/**
|
||||
* Return absolute paths array of SVG files data located inside '@svgDir/static'
|
||||
*/
|
||||
public getStatic(): Svg[] {
|
||||
const staticDir = path.resolve(this.svgDir, "static");
|
||||
|
||||
if (!fs.existsSync(staticDir)) {
|
||||
console.log(`${this.svgDir} contains semi-animated .svg files`);
|
||||
this.semiAnimated = true;
|
||||
return [];
|
||||
} else {
|
||||
const svgs = fs
|
||||
.readdirSync(staticDir)
|
||||
.map((f) => this.readData(path.resolve(staticDir, f)));
|
||||
|
||||
if (svgs.length == 0) {
|
||||
throw new Error("Static Cursors directory is empty");
|
||||
}
|
||||
return svgs;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Return absolute paths array of SVG files data located inside '@svgDir/animated'
|
||||
*/
|
||||
public getAnimated(): Svg[] {
|
||||
const animatedDir = path.resolve(this.svgDir, "animated");
|
||||
|
||||
if (!fs.existsSync(animatedDir)) {
|
||||
throw new Error("Animated Cursors directory not found");
|
||||
}
|
||||
|
||||
const svgs = fs
|
||||
.readdirSync(animatedDir)
|
||||
.map((f) => this.readData(path.resolve(animatedDir, f)));
|
||||
|
||||
if (svgs.length == 0 && this.semiAnimated) {
|
||||
throw new Error(
|
||||
`Can't parse svg directory ${this.svgDir} as semi-animated theme`
|
||||
);
|
||||
}
|
||||
|
||||
return svgs;
|
||||
}
|
||||
}
|
||||
|
||||
export { SvgDirectoryParser };
|
||||
@@ -1,52 +0,0 @@
|
||||
import { Colors } from "../types";
|
||||
|
||||
/**
|
||||
* Default Key Colors for generating colored svg.
|
||||
* base="#00FF00" (Green)
|
||||
* outline="#0000FF" (Blue)
|
||||
* watch.background="#FF0000" (Red)
|
||||
* */
|
||||
const defaultKeyColors: Colors = {
|
||||
base: "#00FF00",
|
||||
outline: "#0000FF",
|
||||
watch: {
|
||||
background: "#FF0000",
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Customize colors of svg code.
|
||||
* @param {string} content SVG code.
|
||||
* @param {Colors} colors Customize colors.
|
||||
* @param {Colors} [keys] Colors Key, That was written SVG code.
|
||||
* @returns {string} SVG code with colors.
|
||||
*/
|
||||
const colorSvg = (
|
||||
content: string,
|
||||
colors: Colors,
|
||||
keys: Colors = defaultKeyColors
|
||||
): string => {
|
||||
content = content
|
||||
.replace(new RegExp(keys.base, "ig"), colors.base)
|
||||
.replace(new RegExp(keys.outline, "ig"), colors.outline);
|
||||
|
||||
try {
|
||||
// === trying to replace `watch` color ===
|
||||
|
||||
if (!colors.watch?.background) {
|
||||
throw new Error("");
|
||||
}
|
||||
const { background: b } = colors.watch;
|
||||
content = content.replace(new RegExp(keys.watch!.background, "ig"), b); // Watch Background
|
||||
} catch (error) {
|
||||
// === on error => replace `watch` color as `base` ===
|
||||
|
||||
content = content.replace(
|
||||
new RegExp(keys.watch!.background, "ig"),
|
||||
colors.base
|
||||
);
|
||||
}
|
||||
return content;
|
||||
};
|
||||
|
||||
export { colorSvg };
|
||||
@@ -1,4 +0,0 @@
|
||||
import { colorSvg } from "./colorSvg";
|
||||
import { SvgDirectoryParser } from "./SvgDirectoryParser";
|
||||
|
||||
export { colorSvg, SvgDirectoryParser };
|
||||
@@ -1,4 +0,0 @@
|
||||
import { BitmapsGenerator } from "./BitmapsGenerator";
|
||||
import * as SVGHandler from "./SVGHandler";
|
||||
|
||||
export { BitmapsGenerator, SVGHandler };
|
||||
@@ -1,20 +0,0 @@
|
||||
/**
|
||||
* Hex Colors in string Format.
|
||||
*
|
||||
* `Example: `"#FFFFFF"
|
||||
*/
|
||||
type HexColor = string;
|
||||
|
||||
/**
|
||||
* @Colors expect `base`, `outline` & `watch-background` colors in **HexColor** Format.
|
||||
* @default background is `base` color.
|
||||
*/
|
||||
type Colors = {
|
||||
base: HexColor;
|
||||
outline: HexColor;
|
||||
watch?: {
|
||||
background: HexColor;
|
||||
};
|
||||
};
|
||||
|
||||
export { Colors };
|
||||
@@ -1,7 +0,0 @@
|
||||
export const frameNumber = (index: number, padding: number) => {
|
||||
let result = "" + index;
|
||||
while (result.length < padding) {
|
||||
result = "0" + result;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
import Pixelmatch from "pixelmatch";
|
||||
import { PNG } from "pngjs";
|
||||
|
||||
export const matchImages = (img1: Buffer, img2: Buffer): number => {
|
||||
const { data: img1Data, width, height } = PNG.sync.read(img1);
|
||||
const { data: imgNData } = PNG.sync.read(img2);
|
||||
|
||||
return Pixelmatch(img1Data, imgNData, null, width, height, {
|
||||
threshold: 0.1,
|
||||
});
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
export const template = `
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Render Template</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container">
|
||||
<svginjection>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
export const toHTML = (svgData: string): string =>
|
||||
template.replace("<svginjection>", svgData);
|
||||
@@ -1,37 +0,0 @@
|
||||
import path from "path";
|
||||
|
||||
import { BitmapsGenerator, SVGHandler } from "./core";
|
||||
import { config } from "./config";
|
||||
|
||||
const root = path.resolve(__dirname, "../../");
|
||||
const svgDir = path.resolve(root, "svg");
|
||||
|
||||
const main = async () => {
|
||||
for (const { themeName, color } of config) {
|
||||
console.log("=>", themeName);
|
||||
|
||||
const bitmapsDir = path.resolve(root, "bitmaps", themeName);
|
||||
const svg = new SVGHandler.SvgDirectoryParser(svgDir);
|
||||
|
||||
const png = new BitmapsGenerator(bitmapsDir);
|
||||
const browser = await png.getBrowser();
|
||||
|
||||
for (let { key, content } of svg.getStatic()) {
|
||||
console.log(" -> Saving", key, "...");
|
||||
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
await png.generateStatic(browser, content, key);
|
||||
}
|
||||
|
||||
for (let { key, content } of svg.getAnimated()) {
|
||||
console.log(" -> Saving", key, "...");
|
||||
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
await png.generateAnimated(browser, content, key, { playbackRate: 0.3 });
|
||||
}
|
||||
|
||||
await browser.close();
|
||||
}
|
||||
};
|
||||
|
||||
main();
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"strictNullChecks": true,
|
||||
"esModuleInterop": true,
|
||||
"target": "ES2015",
|
||||
"module": "commonjs",
|
||||
"lib": ["es2015", "dom"],
|
||||
"noUnusedParameters": true
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 6.9 KiB |