-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change build system, revamp docs & speedup generation (#19)
- Loading branch information
Showing
8,970 changed files
with
270 additions
and
190 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: build | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: extractions/setup-just@v2 | ||
- name: Install dependencies | ||
run: sudo apt update && sudo apt install -y inkscape x11-apps | ||
- name: Generate cursors | ||
run: just all | ||
- name: Build zips | ||
run: just zip | ||
- name: Set outputs | ||
id: vars | ||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: 'catppuccin-cursors-${{ steps.vars.outputs.sha_short }}' | ||
path: releases/*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
pngs/ | ||
releases/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Volantes cursors, based on KDE Breeze | ||
# Copyright (c) 2016 Keefer Rourke <keefer.rourke@gmail.com> | ||
# Copyright (c) 2020 Sergei Eremenko <https://github.com/SmartFinn> | ||
|
||
set -eu | ||
|
||
INKSCAPE_VERSION=$(inkscape --version 2>/dev/null | awk '/Inkscape[ ]/ {print $2; exit}') | ||
|
||
# Generates the commands required for SVG -> PNG conversion | ||
# These commands are to be used within inkscape's "shell" mode which allows for batch processing in a single inkscape process | ||
generate_inkscape_commands() { | ||
local src_dir="$1" | ||
local out_dir="$2" | ||
local file size bitmap_file | ||
|
||
[ -d "$src_dir" ] || return 1 | ||
[ -d "$out_dir" ] || mkdir -p "$out_dir" | ||
|
||
# shellcheck disable=SC2016 | ||
for file in "$src_dir"/*.svg; do | ||
[ -f "$file" ] || continue | ||
for size in 24 32 48 64; do | ||
bitmap_file="${out_dir%/}/$(basename "$file" .svg)_${size}.png" | ||
INKSCAPE_COMMANDS+="file-open:$file; export-filename:$bitmap_file; export-height:$size; export-width:$size; export-do; file-close;" | ||
done | ||
done | ||
} | ||
|
||
convert_to_x11cursor() { | ||
local src_dir="$1" | ||
local out_dir="$2" | ||
local config base_name | ||
|
||
[ -d "$src_dir" ] || return 1 | ||
|
||
if [ -d "$out_dir" ]; then | ||
rm -rf "$out_dir" | ||
fi | ||
|
||
mkdir -p "$out_dir" | ||
|
||
for config in "$CONFIG_DIR"/*.cursor; do | ||
[ -f "$config" ] || continue | ||
base_name="$(basename "$config" .cursor)" | ||
xcursorgen -p "$src_dir" "$config" "$out_dir/$base_name" | ||
done | ||
} | ||
|
||
create_aliases() { | ||
local out_dir="$1" | ||
local symlink target | ||
|
||
while read -r symlink target; do | ||
[ -e "$out_dir/$symlink" ] && continue | ||
ln -sf "$target" "$out_dir/$symlink" | ||
done <"$ALIASES" | ||
} | ||
|
||
SCRIPT_DIR="$(dirname "$0")" | ||
SRC_DIR="$SCRIPT_DIR/src" | ||
OUT_DIR="$SCRIPT_DIR/dist" | ||
PNG_DIR="$SCRIPT_DIR/pngs" | ||
BUILD_DIR="$SCRIPT_DIR/build" | ||
CONFIG_DIR="$SRC_DIR/config" | ||
|
||
AUTHORS="$SCRIPT_DIR/AUTHORS" | ||
LICENSE="$SCRIPT_DIR/LICENSE" | ||
ALIASES="$SRC_DIR/cursorList" | ||
|
||
ACCENTS="blue dark flamingo green lavender light maroon mauve peach pink red rosewater sapphire sky teal yellow" | ||
INKSCAPE_COMMANDS="" | ||
|
||
while getopts "f:a:v" option; do | ||
case $option in | ||
f) | ||
FLAVOR="$OPTARG" | ||
;; | ||
a) | ||
ACCENTS="$OPTARG" | ||
;; | ||
v) | ||
DEBUG=1 | ||
echo "[DEBUG] - Debug logging enabled" | ||
;; | ||
\?) | ||
echo "Invalid option: -$OPTARG" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
echo "[INFO] - Flavor: '$FLAVOR'" | ||
echo "[INFO] - Accent(s): '$ACCENTS'" | ||
|
||
echo "[INFO] - Generating inkscape commands..." | ||
for accent in $ACCENTS; do | ||
theme_name="catppuccin-$FLAVOR-$accent-cursors" | ||
theme_src_dir="$SRC_DIR/$theme_name" | ||
theme_build_dir="$BUILD_DIR/$theme_name" | ||
theme_out_dir="$OUT_DIR/$theme_name" | ||
theme_png_dir="$PNG_DIR/$theme_name" | ||
|
||
generate_inkscape_commands "$theme_src_dir" "$theme_png_dir" | ||
done | ||
echo "[INFO] - Generating inkscape commands complete" | ||
|
||
echo "[INFO] - Converting SVGs to PNGs..." | ||
inkscape --shell <<< ${INKSCAPE_COMMANDS} &> /dev/null | ||
echo "[INFO] - Converting SVGs to PNGs complete" | ||
|
||
echo "[INFO] - Converting to x11cursor & creating aliases..." | ||
for accent in $ACCENTS; do | ||
theme_name="catppuccin-$FLAVOR-$accent-cursors" | ||
theme_src_dir="$SRC_DIR/$theme_name" | ||
theme_build_dir="$BUILD_DIR/$theme_name" | ||
theme_out_dir="$OUT_DIR/$theme_name" | ||
theme_png_dir="$PNG_DIR/$theme_name" | ||
|
||
convert_to_x11cursor "$theme_png_dir" "$theme_out_dir/cursors" | ||
create_aliases "$theme_out_dir/cursors" | ||
|
||
cp -f "$theme_src_dir/index.theme" "$theme_out_dir" | ||
cp -f "$AUTHORS" "$theme_out_dir" | ||
cp -f "$LICENSE" "$theme_out_dir" | ||
done | ||
echo "[INFO] - Converting to x11cursor & creating aliases complete" |
Oops, something went wrong.