-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathchange-colours.sh
executable file
·122 lines (94 loc) · 4.96 KB
/
change-colours.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
#!/bin/bash
### Description : Replace the standard colour (or colours) with a personal colour (or colours).
### CSV files are actually also text files. You can edit them.
### Written by Erik Dubois 01-2017
### How to find your personal colour
### Gpick is the tool I use to find a suitable color. Every operating system has its tool.
### Type 'sudo apt install gpick' in a terminal in order to install gpick.
### You can go online to find colour codes.
### You need hexadecimal colour codes like 'a1a1a1'.
### How to proceed
### Copy/paste the icon folder and work on a copy. Never work on the original.
### Change the name of the folder if you know what colour you will use already.
### Change the name of your new icon theme inside the file 'index.theme' as well.
### Common mistakes
### Do not put '#' in front of the hexadecimal code
### Do not put 'ff' at the end of the hexadecimal code when you copy/paste from inkscape.
### When copy/pasting from inkscape the last two stand for the transparency.
### Things to remember
### You can only have 6 alfanumeric positions
### Do not use short colour description like "fff" instead of 'ffffff'. It will confuse you over time.
### Use no capital letters and use only small letters. It will confuse you over time.
### Use 'a1a1a1' rather than 'A1A1A1'.
### Beneath is the old colour we are going to change.
### With the help of inkscape or other tools we know the colour of the original icons.
### Do not change this line.
### We will put this colour in a variable to be able to use it later.
### If you run this script without changing the newcolour. Nothing will change.
### Icons have seven parts
### Body
### Bodyborder
### Paper
### Paperborder
### Back
### Icon
### Icon shadow (not changed)
oldbodycolour=1793d1
oldbodybordercolour=039be5
oldpapercolour=fffbec
oldpaperbordercolour=e8e5dc
oldbackcolour=0288d1
oldcolouricons=b3e5fc
### With the help of tools like gpick you have decided for an hexadecimal colour.
### Copy/paste this hexadecimal code in the next line replacing the colour.
### Icons have seven parts
### Body
### Bodyborder
### Paper
### Paperborder
### Back
### Icon
### Icon shadow (not changed
newbodycolour=1793d1
newbodybordercolour=039be5
newpapercolour=fffbec
newpaperbordercolour=e8e5dc
newbackcolour=0288d1
newcolouricons=b3e5fc
### Do not change the next lines
### Now all the icons will change colour.
### The command will do the following
### Find all svg's in the folder scalable/places that are of type 'files' (no symlinks) and replace the oldcolour
### with the newcolour but anything white (ffffff) will never change.
### Only folder places
# Folder body portion
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill="#'$oldbodycolour'"/fill="#'$newbodycolour'"/g' {} \;
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill:#'$oldbodycolour'/fill:#'$newbodycolour'/g' {} \;
# Folder bodyborder portion
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill="#'$oldbodybordercolour'"/fill="#'$newbodybordercolour'"/g' {} \;
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill:#'$oldbodybordercolour'/fill:#'$newbodybordercolour'/g' {} \;
# Folder paper portion
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill="#'$oldpapercolour'"/fill="#'$newpapercolour'"/g' {} \;
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill:#'$oldpapercolour'/fill:#'$newpapercolour'/g' {} \;
# Folder paperborder portion
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill="#'$oldpaperbordercolour'"/fill="#'$newpaperbordercolour'"/g' {} \;
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill:#'$oldpaperbordercolour'/fill:#'$newpaperbordercolour'/g' {} \;
# Folder back portion
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill="#'$oldbackcolour'"/fill="#'$newbackcolour'"/g' {} \;
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill:#'$oldbackcolour'/fill:#'$newbackcolour'/g' {} \;
# Icons on the folders
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill="#'$oldcolouricons'"/fill="#'$newcolouricons'"/g' {} \;
find scalable/places -name "*.svg" -type f -exec sed -i 's/fill:#'$oldcolouricons'/fill:#'$newcolouricons'/g' {} \;
# Changing the stroke colour
#find scalable/places -name "*.svg" -type f -exec sed -i 's/stroke:#'$oldcolouricons'/stroke:#'$newcolouricons'/g' {} \;
#find scalable/places -name "*.svg" -type f -exec sed -i 's/stroke="#'$oldcolouricons'"/stroke:#'$newcolouricons'/g' {} \;
### Auto update the iconcache
### Do a manual update with following code in a terminal if you get errors
### gtk-update-icon-cache -f iconthemefolder
gtk-update-icon-cache -f ../$(basename `pwd`)
### Give your new icon theme a proper name.
### Gpick gives you the name of the colour. You can use that as a reference or not.
### Change the name of your new icon theme inside the file 'index.theme' as well.
### This is only mandatory for XFCE.
### Select the new theme with your theme manager
### Have fun creating new themes.