From 6caa72e729ed9cea105499b1ef9fc6c07073a50b Mon Sep 17 00:00:00 2001 From: dell Date: Sun, 30 Mar 2025 07:09:44 +0500 Subject: [PATCH] add svg-cursor build steps to build.sh based on https://github.com/jinliu/svg-cursor/tree/main/build-svg-theme, including the script in that repo --- build.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index e201de9..875df99 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,8 @@ #! /usr/bin/env bash +# from where the command was run +ROOT=$(pwd) + # check command avalibility has_command() { command -v "$1" >/dev/null 2>&1 @@ -35,6 +38,21 @@ if [ ! "$(which rsvg-convert 2> /dev/null)" ]; then fi fi +if [ ! "$(which python3 2> /dev/null)" ]; then + echo python3 needs to be installed to generate svg cursors. + if has_command zypper; then + sudo zypper install -y python3 + elif has_command apt-get; then + sudo apt-get install -y python3 + elif has_command dnf; then + sudo dnf install -y python3 + elif has_command yum; then + sudo dnf install -y python3 + elif has_command pacman; then + sudo pacman -S --noconfirm python + fi +fi + function create { cd "$SRC" mkdir -p x1 x1_25 x1_5 x2 @@ -95,8 +113,19 @@ function create { } # generate pixmaps from svg source -SRC=$PWD/src +SRC=$ROOT/src THEME="WhiteSur Cursors" -create svg +function svg-cursors { + cd $ROOT + rm -rf ./svg-cursor/ + rm -rf ./dist/cursors_scalable/ + git clone https://github.com/jinliu/svg-cursor.git + echo -e "Generating SVG cursors...\\r" + ./svg-cursor/build-svg-theme/build-svg-theme.py --output-dir=$ROOT/dist/cursors_scalable --svg-dir=$SRC/svg --config-dir=$SRC/config --alias-file=$SRC/cursorList --nominal-size=24 + echo -e "Generating SVG cursors... DONE" +} + +create svg +svg-cursors