Mint-Y-icons: how to automate the creation of a new color for places folder?

Style your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
antrrax
Level 1
Level 1
Posts: 33
Joined: Thu Sep 27, 2018 11:53 am

Mint-Y-icons: how to automate the creation of a new color for places folder?

Post by antrrax »

https://github.com/linuxmint/mint-y-icons

I'm using github scripts to create a custom color for the icons in the 'places' directory. But I'm not able to automate the creation of symbolic links to the 'places' folder.
Also, I can't automate the creation of the 'index.theme' file, using only the scripts available on the site.

I'm doing it wrong, or there's no automation for it in the github scripts.

I'm trying through this script to add a new icon color and render the files.

Code: Select all

#!/usr/bin/env bash
set -e

SYSTEM_USER=false   #$HOME/.icons
#SYSTEM_USER=true   #/usr/share/icons/

VARIATION_NAME="Yellow-New"
VARIATION_SVG_COLOR="ffe35f"

MINT_Y_GIT="https://github.com/linuxmint/mint-y-icons/archive/refs/heads/master.zip"
OUTPUT_NAME_GIT="mint-y-icons-master"

INIT_DIR="$PWD/$OUTPUT_NAME_GIT"
SVG_PLACES="$INIT_DIR/src/places"
VARIATION_SVG_NAME=${VARIATION_NAME,,}
#==============

wget -c "$MINT_Y_GIT" -P "$PWD" -O "$OUTPUT_NAME_GIT.zip"

echo "=========> Unzip File"
unzip -qq -o "./$OUTPUT_NAME_GIT.zip"


if [ -d "$INIT_DIR/usr/share/icons/Mint-Y-$VARIATION_NAME" ]; then
    rm -fr "$INIT_DIR/usr/share/icons/Mint-Y-$VARIATION_NAME"
fi


if ! grep -q "COLORS\[\"$VARIATION_SVG_NAME\"\] = \"$VARIATION_SVG_COLOR\"" "$SVG_PLACES/generate-color-variations.py" ; then
    echo "=========> Modifying file: $SVG_PLACES/generate-color-variations.py"
    sed -i "s/GREEN_COLOR = \"8bb158\"/COLORS[\"$VARIATION_SVG_NAME\"] = \"$VARIATION_SVG_COLOR\"\n\nGREEN_COLOR = \"8bb158\"/g" "$SVG_PLACES/generate-color-variations.py"
fi

echo "=========> Generating file: $SVG_PLACES/$VARIATION_SVG_NAME.svg"
cd "$SVG_PLACES"
"./generate-color-variations.py"


if ! grep -q "\"$VARIATION_NAME\"" "$INIT_DIR/src/render_places.py" ; then
    echo "=========> Modifying file(Add new color): $INIT_DIR/src/render_places.py"
    sed -i "s/colors = \[/colors = \[\"$VARIATION_NAME\", /g" "$INIT_DIR/src/render_places.py"
    sed -i "s/ or All./, $VARIATION_NAME or All./g" "$INIT_DIR/src/render_places.py"
fi


echo "=========> Rendering files:"
cd "$INIT_DIR/src"
"./render_places.py" "$VARIATION_NAME"


echo -e "=========> Compressing file: $INIT_DIR/$VARIATION_NAME.tar.gz"
cd "$INIT_DIR/usr/share/icons"
tar -zcf "$INIT_DIR/$VARIATION_NAME.tar.gz" "Mint-Y-$VARIATION_NAME"


if [ -d "$HOME/.icons/Mint-Y-$VARIATION_NAME" ]; then
    echo -e "=========> Removing folder: $HOME/.icons/Mint-Y-$VARIATION_NAME\n"
    rm -fr "$HOME/.icons/Mint-Y-$VARIATION_NAME"
fi


if [ "$SYSTEM_USER" = true ]; then
    if [ -d "/usr/share/icons/Mint-Y-$VARIATION_NAME" ]; then
        echo -e "=========> Removing folder: /usr/share/icons/Mint-Y-$VARIATION_NAME\n"
        sudo rm -fr "/usr/share/icons/Mint-Y-$VARIATION_NAME"
    fi

    echo -e "=========> Unpacking file to: /usr/share/icons/"
    sudo tar zxf "$INIT_DIR/$VARIATION_NAME".tar.gz -C "/usr/share/icons/"

else
    mkdir -p "$HOME/.icons"
    echo -e "=========> Unpacking file to: $HOME/.icons"
    tar zxf "$INIT_DIR/$VARIATION_NAME".tar.gz -C "$HOME/.icons"

    if [ -d "/usr/share/icons/Mint-Y-$VARIATION_NAME" ]; then
        echo -e "=========> Removing folder: /usr/share/icons/Mint-Y-$VARIATION_NAME\n"
        sudo rm -fr "/usr/share/icons/Mint-Y-$VARIATION_NAME"
    fi
fi
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
sebastjava
Level 5
Level 5
Posts: 713
Joined: Wed Jun 28, 2017 8:01 pm
Location: Montréal, Québec, Canada
Contact:

Re: Mint-Y-icons: how to automate the creation of a new color for places folder?

Post by sebastjava »

I don't have much time now, so i couldn't take a look at your script...

If you have plenty of spare time, take a look at my fork:
https://github.com/SebastJava/mint-yz-icons

And, more precisely:
Build step-by-step
The future Linux Mint Forums is here.
Self-Appointed Benevolent Designer on Linux Mint Cinnamon.
Image
Locked

Return to “Themes, Icons & Wallpaper”