-
Notifications
You must be signed in to change notification settings - Fork 8
/
1-change-color.sh
executable file
·127 lines (97 loc) · 4.36 KB
/
1-change-color.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/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.
#
##################################################################################################################
# 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
##################################################################################################################
##################################################################################################################
##################################################################################################################
# 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
#original light version is #9ab87c
personallightcolour=fd424d
#original dark version is #8fa876
personaldarkcolour=fd424d
# 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 "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
oldcolour1=9ab87c
#original dark version is #8fa876
oldcolour2=8fa876
#other colour variations in svg
oldcolour3=779559
oldcolour4=9abe76
oldcolour5=9ab87d
oldcolour6=88a66a
oldcolour7=81a65b
newcolour1=$personallightcolour
newcolour2=$personaldarkcolour
newcolour3=$personaldarkcolour
newcolour4=$personallightcolour
newcolour5=$personallightcolour
newcolour6=$personallightcolour
newcolour7=$personaldarkcolour
find src -name "*.*" -type f -exec sed -i 's/'$oldcolour1'/'$newcolour1'/g' {} \;
find src -name "*.*" -type f -exec sed -i 's/'$oldcolour2'/'$newcolour2'/g' {} \;
find src -name "*.*" -type f -exec sed -i 's/'$oldcolour3'/'$newcolour3'/g' {} \;
find src -name "*.*" -type f -exec sed -i 's/'$oldcolour4'/'$newcolour4'/g' {} \;
find src -name "*.*" -type f -exec sed -i 's/'$oldcolour5'/'$newcolour5'/g' {} \;
find src -name "*.*" -type f -exec sed -i 's/'$oldcolour6'/'$newcolour6'/g' {} \;
find src -name "*.*" -type f -exec sed -i 's/'$oldcolour7'/'$newcolour7'/g' {} \;
#Rubberband Solution for now
#border
oldcolour1=76905b
find src -type f -exec sed -i 's/'$oldcolour1'/'$newcolour1'/g' {} \;
#background of rubberband is in rgba
#from hex to decimal
redhex=${newcolour1:0:2}
greenhex=${newcolour1:2:2}
bluehex=${newcolour1:4:2}
reddec=$((16#$redhex))
greendec=$((16#$greenhex))
bluedec=$((16#$bluehex))
rgbacolour="$reddec, $greendec, $bluedec"
#old rgba colour of background rubberband
oldcolour1="118, 144, 91"
newcolour1=$rgbacolour
#gtk-dark rubberband
find src -type f -exec sed -i "s/$oldcolour1/$newcolour1/g" {} \;
#gtk + gtk-darker rubberband
oldcolour1="129, 166, 91"
find src -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"