From f06f58c1cb75ad86fee5c513b71effafc76dcc47 Mon Sep 17 00:00:00 2001 From: LOSEARDES77 Date: Thu, 11 Apr 2024 17:50:48 +0200 Subject: [PATCH] Update hyprcursor-build.sh to move SVG files to the extracted hyprcursor && add documentation --- README.md | 28 ++++++++++++++++++++++++++++ hyprcursor-build.sh | 21 ++++++++++++--------- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1a527e13..6e889c0c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ +# Hyprcursor roadmap + +- [x] extract themes +- [x] recolor svgs +- [x] remove old png files +- [ ] edit mate.hl files to use svg +- [ ] compress the theme + + +### How it works? + +new files: +- hyprcursor-build.sh: + - Gets called at the end of the build script to compile hyprcursor + - Extracts themes from generated xcursor themes in the hyprcursor-build directory + - Calls recolor-svgs.py to generate colored svg files + - deletes old png files replacing theme with svgs + +- recolor-svgs.py: + - gets called from hyprcursor-build.sh + - reads the colors in render.json + - generates new svg files with the desired colors in the hyprcursor-build directory + + + + +--- + ## ⚠️ Notice: Final Major Version v2.x.x I've launched the successor to this project at https://www.github.com/ful1e5/bibata for **downloading and personalizing Bibata**, now the main source for new features. I recommend downloading from there. This repository is still maintained for [Linux packages](#packages). diff --git a/hyprcursor-build.sh b/hyprcursor-build.sh index 07f79492..52b8da71 100755 --- a/hyprcursor-build.sh +++ b/hyprcursor-build.sh @@ -15,23 +15,26 @@ for theme in $(find ./hyprcursor-build -maxdepth 1 -type d | grep "extracted_Bib theme_name=$(basename "$theme") for shape in $(find "$theme/hyprcursors" -maxdepth 2 -type d); do shape_name=$(basename "$shape") - svg_file=$(find "./hyprcursor-build/recolored_svgs/$theme_base" -name "$shape_name.svg" | grep "$shape_name") + svg_files=$(find "./hyprcursor-build/recolored_svgs/$theme_base" -name "$shape_name.svg" | grep "$shape_name") theme_base=$(echo "$theme_name" | cut -d'_' -f2) - if [ -z "$svg_file" ]; then + if [ -z "$svg_files" ]; then if [ "$shape_name" == "wait" ]; then - svg_file=$(find "./hyprcursor-build/recolored_svgs/$theme_base/wait/" -name "*.svg") + svg_files=$(find "./hyprcursor-build/recolored_svgs/$theme_base/wait/" -name "*.svg") elif [ "$shape_name" == "left_ptr_watch" ]; then - svg_file=$(find "./hyprcursor-build/recolored_svgs/$theme_namebase/left_ptr_watch/" -name "*.svg") + svg_files=$(find "./hyprcursor-build/recolored_svgs/$theme_namebase/left_ptr_watch/" -name "*.svg") fi fi - echo "$theme_base: $shape_name -> $svg_file" - if [ -z "$svg_file" ]; then + echo "$theme_base: $shape_name -> $svg_files" + if [ -z "$svg_files" ]; then echo "No SVG file found for $theme_base: $shape_name" exit 1 fi - # TODO: edit the meta.hl file - # TODO: copy the svg files to the extracted hyprcursor - + rm -rf "$shape/*.png" + + for svg_file in $svg_files; do + mv "$svg_file" "$shape" + done + # TODO: edit the meta.hl files done done \ No newline at end of file -- 2.51.2