1#!/usr/local/bin/bash 2# 3# This file is part of plata-theme 4# 5# Copyright (C) 2018-2020 Tista <tista.gma500@gmail.com> 6# 7# This program is free software; you can redistribute it and/or modify 8# it under the terms of the GNU General Public License as published by 9# the Free Software Foundation; either version 2 of the License, or 10# (at your option) any later version. 11# 12 13SRC_DIR="../assets-xfwm/" 14RECOLOR_FILE1="close-pressed.svg" 15RECOLOR_FILE2="close-prelight.svg" 16COL_FILE="../../../gtk/sass/common/_colors.scss" 17KEY_FILE="../../../gtk/sass/common/resources/_key_colors.scss" 18 19# Default colours 20selection1="`grep 'Indigo500' $COL_FILE | \ 21 cut -d' ' -f3`" 22destruction1="`grep 'Red500' $COL_FILE | \ 23 cut -d' ' -f3`" 24 25# Check and re-color 'close-pressed' and 'menu-pressed' button 26if [ -e $KEY_FILE ]; then 27 selection2="`grep 'key_selection' $KEY_FILE | \ 28 cut -d' ' -f2 | cut -d';' -f1`" 29 destruction2="`grep 'key_destruction' $KEY_FILE | \ 30 cut -d' ' -f2 | cut -d';' -f1`" 31 32 cp -f $SRC_DIR/light/$RECOLOR_FILE1.in $SRC_DIR/light/$RECOLOR_FILE1 33 cp -f $SRC_DIR/dark/$RECOLOR_FILE1.in $SRC_DIR/dark/$RECOLOR_FILE1 34 cp -f $SRC_DIR/light-compact/$RECOLOR_FILE1.in $SRC_DIR/light-compact/$RECOLOR_FILE1 35 cp -f $SRC_DIR/dark-compact/$RECOLOR_FILE1.in $SRC_DIR/dark-compact/$RECOLOR_FILE1 36 cp -f $SRC_DIR/light/$RECOLOR_FILE2.in $SRC_DIR/light/$RECOLOR_FILE2 37 cp -f $SRC_DIR/dark/$RECOLOR_FILE2.in $SRC_DIR/dark/$RECOLOR_FILE2 38 cp -f $SRC_DIR/light-compact/$RECOLOR_FILE2.in $SRC_DIR/light-compact/$RECOLOR_FILE2 39 cp -f $SRC_DIR/dark-compact/$RECOLOR_FILE2.in $SRC_DIR/dark-compact/$RECOLOR_FILE2 40 41 if [ $selection1 != $selection2 ]; then 42 sed -i '' "s/$selection1/$selection2/gi" $SRC_DIR/light/$RECOLOR_FILE1 43 sed -i '' "s/$selection1/$selection2/gi" $SRC_DIR/dark/$RECOLOR_FILE1 44 sed -i '' "s/$selection1/$selection2/gi" $SRC_DIR/light-compact/$RECOLOR_FILE1 45 sed -i '' "s/$selection1/$selection2/gi" $SRC_DIR/dark-compact/$RECOLOR_FILE1 46 echo $selection1 is re-colored with $selection2. 47 fi 48 49 if [ $destruction1 != $destruction2 ]; then 50 sed -i '' "s/$destruction1/$destruction2/gi" $SRC_DIR/light/$RECOLOR_FILE2 51 sed -i '' "s/$destruction1/$destruction2/gi" $SRC_DIR/dark/$RECOLOR_FILE2 52 sed -i '' "s/$destruction1/$destruction2/gi" $SRC_DIR/light-compact/$RECOLOR_FILE2 53 sed -i '' "s/$destruction1/$destruction2/gi" $SRC_DIR/dark-compact/$RECOLOR_FILE2 54 echo $destruction1 is re-colored with $destruction2. 55 fi 56else 57 echo ../../../gtk/sass/common/resources/_key_colors.scss was not found. Stopped... 58 exit 1 59fi 60