Skip to content

Commit

Permalink
slimming down scripts, adding command line arguments, theme color def…
Browse files Browse the repository at this point in the history
…initions in json file, added all colors from old colora-theme-colection
  • Loading branch information
kunesj committed Nov 17, 2018
1 parent b8bf49a commit f054ba6
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 197 deletions.
5 changes: 4 additions & 1 deletion 0-install-tools.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash
echo "Installing all the needed software to be able to run the scripts."

echo "Installing all software needed to run the scripts."

sudo apt-get install -y git python3 ruby-sass optipng inkscape

78 changes: 20 additions & 58 deletions 1-change-color.sh
Original file line number Diff line number Diff line change
@@ -1,63 +1,29 @@
#!/bin/bash
#
##################################################################################################################
# Written to be used on 64 bits computers
# Author : Erik Dubois
# Website : http://www.erikdubois.be
##################################################################################################################
##################################################################################################################
# Prepare light and dark color in hexadecimal format (6 letters or numbers).
# - Never put a hashtag # in front of the colour code if copy/pasting from gpick
# - Never put "FF" at the end if copy/pasting from inkscape
# Use color values as scrpt arguments in format "1-change-color.sh LIGHT_COLOR DARK_COLOR"
# - example: ./1-change-color.sh 9ab87c 8fa876
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
##################################################################################################################

# changing the assets from colour

# Mint-Y Theme
# Light green - 9ab87c
# Dark green - 8fa876
# but there are some minor green variations to consider as well
# path to Mint-Y source
SRC_DIR="src/Mint-Y"

##################################################################################################################
##################################################################################################################
##################################################################################################################
# put your colour codes in here and do not change the rest
# Never put a hashtag or # in front of the colour code if copy/pasting from gpick
# Never put "FF" at the end if copy/pasting from inkscape
# Always 6 letters or numbers
# THESE CODES MUST BE CHANGED
# THESE CODES MUST BE CHANGED
# THESE CODES MUST BE CHANGED
# THESE CODES MUST BE CHANGED
# get new colors
personallightcolour=$1
personaldarkcolour=$2
if [ $# -ne 2 ]; then
echo "ERROR! Missing (or incorect number of) color values! Using default colors!"
# these are orginal colors
personallightcolour=9ab87c
personaldarkcolour=8fa876
fi


#original light version is #9ab87c
#original dark version is #8fa876
# !!!COLOR_REPLACE_START!!!
personallightcolour=fd424d
personaldarkcolour=fd424d
# !!!COLOR_REPLACE_END!!!

# THESE CODES MUST BE CHANGED
# THESE CODES MUST BE CHANGED
# THESE CODES MUST BE CHANGED
# THESE CODES MUST BE CHANGED
##################################################################################################################
##################################################################################################################
##################################################################################################################


echo "All colours in the folder src are still the original green ones from github!!!"
echo "Choose your colour that will replace the green online or with tools like gpick."
echo "e.g. sudo apt-get install gpick"
echo "All css files but also svg files will be affected"
echo "PNG'S will not be altered with this script"
echo "Changing ....."
echo "Wait for it ...."

##################################################################################################################

## DO NOT CHANGE THESE LINES
## DO NOT CHANGE THESE LINES
## DO NOT CHANGE THESE LINES


#original light version is #9ab87c
Expand All @@ -79,9 +45,8 @@ newcolour3=$personaldarkcolour
newcolour4=$personallightcolour
newcolour5=$personallightcolour
newcolour6=$personallightcolour
newcolour7=$personaldarkcolour
newcolour7=$personaldarkcolour

SRC_DIR="src/Mint-Y"

find $SRC_DIR -type f -exec sed -i 's/'$oldcolour1'/'$newcolour1'/g' {} \;
find $SRC_DIR -type f -exec sed -i 's/'$oldcolour2'/'$newcolour2'/g' {} \;
Expand Down Expand Up @@ -122,7 +87,4 @@ oldcolour1="129, 166, 91"
find $SRC_DIR -type f -exec sed -i "s/$oldcolour1/$newcolour1/g" {} \;


echo "All css files but also svg files will be affected"
echo "PNG'S will not be altered with this script"
echo
echo "Next up delete all assets i.e. png's with script number 2"
echo "Finished! Next, delete all assets i.e. png's with script number 2"
19 changes: 3 additions & 16 deletions 2-delete-assets.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
#!/bin/bash
#
##################################################################################################################
# Written to be used on 64 bits computers
# Author : Erik Dubois
# Website : http://www.erikdubois.be
##################################################################################################################
##################################################################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
##################################################################################################################

# path to Mint-Y source
SRC_DIR="src/Mint-Y"

echo "Deleting all assets i.e. png in the src folder"
echo "Deleting all assets i.e. png in the src folder..."

rm -f $SRC_DIR/gtk-2.0/assets/*.png
rm -f $SRC_DIR/gtk-2.0/assets-dark/*.png
rm -f $SRC_DIR/gtk-2.0/menubar-toolbar/*.png

rm -f $SRC_DIR/gtk-3.0/assets/*.png

echo "All png's have been deleted"
echo "Proceed to making the assets."
echo
echo "Run script number 3 to make the assets."
echo "Finished! Next, run script number 3 to make new assets."
27 changes: 8 additions & 19 deletions 3-make-assets.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
#!/bin/bash
#
##################################################################################################################
# Written to be used on 64 bits computers
# Author : Erik Dubois
# Website : http://www.erikdubois.be
##################################################################################################################
##################################################################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
##################################################################################################################

# path to Mint-Y source
SRC_DIR="src/Mint-Y"


echo "It is time for you to take a coffee."
echo "It will take as long as it takes depending on cpu etc..."
echo "It will take as long as it takes depending on cpu etc."

echo "Making all assets"
echo "Making all assets..."


SRC_DIR="src/Mint-Y"
cd $SRC_DIR

# fix for nonexistent "render-menubar-toolbar.sh" in mint-themes repo
Expand All @@ -31,6 +22,8 @@ cp assets-dark/button-hover.png menubar-toolbar/button-h
cp assets-dark/button-insensitive.png menubar-toolbar/button-insensitive.png
cp assets/menubar.png menubar-toolbar/menubar.png
cp assets-dark/menubar.png menubar-toolbar/menubar-dark.png
cp assets/menubar_button.png menubar-toolbar/menubar_button.png
cp assets-dark/menubar_button.png menubar-toolbar/menubar_button-dark.png
cp assets/toolbar-entry-border-active-bg.png menubar-toolbar/toolbar-entry-border-active-bg.png
cp assets-dark/toolbar-entry-border-active-bg.png menubar-toolbar/toolbar-entry-border-active-bg-dark.png
cp assets/toolbar-entry-border-bg.png menubar-toolbar/toolbar-entry-border-bg.png
Expand All @@ -43,8 +36,4 @@ cd ..
python build-themes.py


echo "All assets have been made."
echo "Svg's have been exported from the assets svg files"
echo "and converted to png's"
echo
echo "Run script number 4 to install the themes."
echo "Finished! Next, run script number 4 to install the themes."
83 changes: 33 additions & 50 deletions 4-moving-the-themes.sh
Original file line number Diff line number Diff line change
@@ -1,78 +1,61 @@
#!/bin/bash
#
##################################################################################################################
# Written to be used on 64 bits computers
# Author : Erik Dubois
# Website : http://www.erikdubois.be
##################################################################################################################
##################################################################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
##################################################################################################################

# Usage:
# ./4-moving-the-themes.sh THEME_NAME
# OR
# ./4-moving-the-themes.sh THEME_NAME THEME_FOLDER

choice=$1

if [ $# -ne 1 ]; then

if [ $# -eq 0 ]; then
echo "Let us rename the folders so they are unique :"
echo "Your name will be added after 'Mint-Y', 'Mint-Y-Dark' or 'Mint-Y-Darker'."
echo "For example if you type Sun you will get"
echo "E.g. Mint-Y-Sun, Mint-Y-Darker-Sun, Mint-Y-Dark-Sun"
echo "E.g. Mint-Y-Sun, Mint-Y-Darker-Sun, Mint-Y-Dark-Sun"

read -p "How should we name this new theme? First letter is a capital letter (no space but '-') : " choice

echo "Renaming the folders"


fi

target=$2
if [ $# -eq 1 ]; then
target=$HOME"/.themes"
fi


# if there is no hidden folder then make one
[ -d $HOME"/.themes" ] || mkdir -p $HOME"/.themes"
cp -rf usr/share/themes/Mint-Y* $HOME"/.themes"


# fix for gtk2 sublime text select menu still green
cp ~/.themes/Mint-Y/gtk-2.0/assets/menubar_button.png ~/.themes/Mint-Y/gtk-2.0/menubar-toolbar/menubar_button-dark.png
cp ~/.themes/Mint-Y/gtk-2.0/assets/menubar_button.png ~/.themes/Mint-Y/gtk-2.0/menubar-toolbar/menubar_button.png

cp ~/.themes/Mint-Y-Dark/gtk-2.0/assets/menubar_button.png ~/.themes/Mint-Y-Dark/gtk-2.0/menubar-toolbar/menubar_button-dark.png
cp ~/.themes/Mint-Y-Dark/gtk-2.0/assets/menubar_button.png ~/.themes/Mint-Y-Dark/gtk-2.0/menubar-toolbar/menubar_button.png

cp ~/.themes/Mint-Y-Darker/gtk-2.0/assets/menubar_button.png ~/.themes/Mint-Y-Darker/gtk-2.0/menubar-toolbar/menubar_button-dark.png
cp ~/.themes/Mint-Y-Darker/gtk-2.0/assets/menubar_button.png ~/.themes/Mint-Y-Darker/gtk-2.0/menubar-toolbar/menubar_button.png

# if there is no themes folder then make one
[ -d $target ] || mkdir -p $target

# remove old version of this theme
cp -rf usr/share/themes/Mint-Y* $target

mv $HOME"/.themes/Mint-Y" $HOME"/.themes/Mint-Y-"$choice
mv $HOME"/.themes/Mint-Y-Dark" $HOME"/.themes/Mint-Y-Dark-"$choice
mv $HOME"/.themes/Mint-Y-Darker" $HOME"/.themes/Mint-Y-Darker-"$choice
# copy theme to destination
mv $target"/Mint-Y" $target"/Mint-Y-"$choice
mv $target"/Mint-Y-Dark" $target"/Mint-Y-Dark-"$choice
mv $target"/Mint-Y-Darker" $target"/Mint-Y-Darker-"$choice

echo "################################################################"
# update theme names in index.theme
echo "################################################################"
echo "Renaming the content of the index.theme"
echo "Mint-Y-Darker-$choice"
find $HOME"/.themes/Mint-Y-Darker-"$choice -name "index.theme" -type f -exec sed -i 's/'Name=Mint-Y-Darker'/'Name=Mint-Y-Darker-$choice'/g' {} \;
find $HOME"/.themes/Mint-Y-Darker-"$choice -name "index.theme" -type f -exec sed -i 's/'GtkTheme=Mint-Y-Darker'/'GtkTheme=Mint-Y-Darker-$choice'/g' {} \;
find $HOME"/.themes/Mint-Y-Darker-"$choice -name "index.theme" -type f -exec sed -i 's/'MetacityTheme=Mint-Y-Dark'/'MetacityTheme=Mint-Y-Darker-$choice'/g' {} \;
echo "################################################################"
find $target"/Mint-Y-Darker-"$choice -name "index.theme" -type f -exec sed -i 's/'Name=Mint-Y-Darker'/'Name=Mint-Y-Darker-$choice'/g' {} \;
find $target"/Mint-Y-Darker-"$choice -name "index.theme" -type f -exec sed -i 's/'GtkTheme=Mint-Y-Darker'/'GtkTheme=Mint-Y-Darker-$choice'/g' {} \;
find $target"/Mint-Y-Darker-"$choice -name "index.theme" -type f -exec sed -i 's/'MetacityTheme=Mint-Y-Dark'/'MetacityTheme=Mint-Y-Darker-$choice'/g' {} \;
echo "################################################################"
echo "Renaming inside the index.theme"
echo "Mint-Y-Dark-$choice"
find $HOME"/.themes/Mint-Y-Dark-"$choice -name "index.theme" -type f -exec sed -i 's/'Name=Mint-Y-Dark'/'Name=Mint-Y-Dark-$choice'/g' {} \;
find $HOME"/.themes/Mint-Y-Dark-"$choice -name "index.theme" -type f -exec sed -i 's/'GtkTheme=Mint-Y-Dark'/'GtkTheme=Mint-Y-Dark-$choice'/g' {} \;
find $HOME"/.themes/Mint-Y-Dark-"$choice -name "index.theme" -type f -exec sed -i 's/'MetacityTheme=Mint-Y-Dark'/'MetacityTheme=Mint-Y-Dark-$choice'/g' {} \;
echo "################################################################"
find $target"/Mint-Y-Dark-"$choice -name "index.theme" -type f -exec sed -i 's/'Name=Mint-Y-Dark'/'Name=Mint-Y-Dark-$choice'/g' {} \;
find $target"/Mint-Y-Dark-"$choice -name "index.theme" -type f -exec sed -i 's/'GtkTheme=Mint-Y-Dark'/'GtkTheme=Mint-Y-Dark-$choice'/g' {} \;
find $target"/Mint-Y-Dark-"$choice -name "index.theme" -type f -exec sed -i 's/'MetacityTheme=Mint-Y-Dark'/'MetacityTheme=Mint-Y-Dark-$choice'/g' {} \;
echo "################################################################"
echo "Renaming inside the index.theme"
echo "Mint-Y-$choice"
find $HOME"/.themes/Mint-Y-"$choice -name "index.theme" -type f -exec sed -i 's/'Name=Mint-Y'/'Name=Mint-Y-$choice'/g' {} \;
find $HOME"/.themes/Mint-Y-"$choice -name "index.theme" -type f -exec sed -i 's/'GtkTheme=Mint-Y'/'GtkTheme=Mint-Y-$choice'/g' {} \;
find $HOME"/.themes/Mint-Y-"$choice -name "index.theme" -type f -exec sed -i 's/'MetacityTheme=Mint-Y'/'MetacityTheme=Mint-Y-$choice'/g' {} \;
find $target"/Mint-Y-"$choice -name "index.theme" -type f -exec sed -i 's/'Name=Mint-Y'/'Name=Mint-Y-$choice'/g' {} \;
find $target"/Mint-Y-"$choice -name "index.theme" -type f -exec sed -i 's/'GtkTheme=Mint-Y'/'GtkTheme=Mint-Y-$choice'/g' {} \;
find $target"/Mint-Y-"$choice -name "index.theme" -type f -exec sed -i 's/'MetacityTheme=Mint-Y'/'MetacityTheme=Mint-Y-$choice'/g' {} \;


echo "The themes have been renamed and moved to your home folder"
echo "in the hidden folder .themes"
echo "The folder was created if you did not have one."
echo "The themes have been renamed and moved to folder: "$target
echo "If you made a mistake, delete the folders in .themes and run the script again."
echo "Select theme with your theme manager and enjoy!"

Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,14 @@ If you are on a different kind of distro, you will need to change package manage

#### 1. Get the source

First, install git:

sudo apt-get install git

Get the latest version of the Linux Mint themes and Mint-Y-Colora with:
Get the latest version of the Linux Mint themes and Mint-Y-Colora theme, download and extract it from browser or clone repo with:

git clone https://github.com/linuxmint/mint-themes.git
git clone https://github.com/kunesj/Mint-Y-Colora-Theme.git

Copy scripts into downloaded mint-themes:
Copy scripts and file with theme definitions into downloaded mint-themes folder:

cp Mint-Y-Colora-Theme/*.sh mint-themes/
cp Mint-Y-Colora-Theme/*.py mint-themes/
cp Mint-Y-Colora-Theme/*.{sh,py,json} mint-themes/

Go inside mint-themes folder and install required tools with:

Expand All @@ -46,22 +41,25 @@ Go inside mint-themes folder and install required tools with:

#### 2. Define name and color of new theme(s)

Find yourself a nice colour with gpick or online. It should be a hexadecimal notation but without the hashtag `#`. Theme name must not have any spaces and will be appended to Mint-Y. example:
Find yourself a nice colour with gpick or online. It should be a hexadecimal notation but without the hashtag `#`.
Theme name must not have any spaces and will be appended to Mint-Y. example:
```
Sun -> Mint-Y-Sun, Mint-Y-Darker-Sun, Mint-Y-Dark-Sun
Sun-Alt -> Mint-Y-Sun-Alt, Mint-Y-Darker-Sun-Alt, Mint-Y-Dark-Sun-Alt
```

Open `autobuild-themes.py` and add line(s) inside `THEMES` dictionary variable. example:
Open `themes.json` and add/replace line(s) with theme definitions. example:
```
THEMES = {
'Numix': {'light': 'd64937', 'dark': 'd64937'},
{
"Smoke": {"light": "A1A1A1", "dark": "A1A1A1"},
"Majestic": {"light": "5F5F5F", "dark": "5F5F5F"}
}
```
Last line must NOT have `,` at the end!

#### 3. Build theme(s)

Build all themes defined in `THEMES` dictionary variable:
Build all themes defined in `themes.json`:
```
./autobuild-themes.py
```
Expand All @@ -85,6 +83,10 @@ If you cant find theme you want to uninstall in this folder, it could be install

# F A Q

#### Can scripts put created themes somewhere else than `~/.themes`?
```
./autobuild-themes.py TARGET_DIR
```

#### I want icons on the toolbar to be white like on the pictures!

Expand Down Expand Up @@ -141,6 +143,7 @@ This is the original Mint-Y-Dark theme with all the little green accents.

# Mint-Y-Colora themes on Linux Mint 18.2

note: These pictures are relatively old


# Mint-Y-Alu
Expand Down
Loading

0 comments on commit f054ba6

Please sign in to comment.