This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
eminence.sh
executable file
·336 lines (315 loc) · 6.5 KB
/
eminence.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
#!/bin/bash
# Copyright 2017 Obsidian-Studios, Inc.
# Author William L. Thomson Jr.
#
# Distributed under the terms of The GNU Public License v3.0 (GPLv3)
# 51 153 255 -> 150 110 220
# 3399ff -> 966edc
VERSION=0.1.13
# Purple color variables
RGB="150 110 220"
HTML="966edc"
HSB="110,72,128"
shopt -s extglob
EDJS=( elementary terminology )
while :
do
case "$1" in
-e | --elementary)
EDJS=( "${EDJS[0]}" )
shift
;;
-t | --terminology)
EDJS=( "${EDJS[1]}" )
shift
;;
-i | --install)
INSTALL=0
shift
;;
*)
break
;;
esac
done
cleanup() {
rm -fr .orig
rm -fr !(assets|eminence-*.edj|eminence.sh|src|LICENSE|README.md)
}
process_edj() {
echo "Creating eminence-${1} v${VERSION}"
[[ -f "eminence-${1}.edj" ]] && rm "eminence-${1}.edj"
#Unpack
edje_decc "/usr/share/${1}/themes/default.edj" -quiet
# Move stuff to current dir
if [[ -d default ]]; then
mv default/* ./
rmdir default
fi
[[ -d "src/${1}/" ]] && cp -r "src/${1}/"* ./
if [[ "${1}" == "elementary" ]]; then
cp -r assets/other/* assets/whitened/* ./
local f
for f in ./*.png ./*.xpm; do
[[ "${f}" =~ arc ]] && mv -v "${f}" "${f/_arc/}"
done
for f in ./toggle-sym-disabled*.png; do
cp -v "${f}" "${f/toggle-sym-disabled/close-btn}"
done
# Remove default.edc file, replaced with eminience.edc
elif [[ "${1}" == "terminology" ]] && [[ -f default.edc ]]; then
rm default.edc
fi
# Sed edc files
local f FILES
mapfile -t FILES < <(find . -name '*.edc' -type f )
for f in "${FILES[@]}"; do
sed -i -e "s|5[1,2] 153 255|${RGB}|g" \
-e "s|3399ff|${HTML}|g" \
"${f}"
if [[ "${f}" != *terminology* ]] && \
[[ "${f}" != *fonts.edc ]]; then
local i
sed -i -e 's|"Sans"|FN|g' \
-e 's|Sans;|FN;|g' \
-e 's|"Sans:style=Bold"|FNBD|g' \
-e 's|Sans:style=Bold|FNBD;|g' \
-e 's|size: 10;|size: FS;|g' \
-e 's|font_size=10|font_size="FS"|g' \
"${f}"
for i in 7 8 9 11 12 14 18 26; do
sed -i -e 's|size: '${i}';|size: FS_'${i}'0;|g' \
-e 's|font_size='${i}'|font_size="FS_'${i}'0"|g' \
"${f}"
done
fi
done
# Temp dir for original pngs
[[ ! -d .orig ]] && mkdir .orig
local p PNGS DEST
if [[ "${1}" == "elementary" ]]; then
mkdir .orig/O
for p in O/digit_na O/digit_nm; do
mv "${p}.png" .orig/O
convert ".orig/${p}.png" -alpha on -channel a \
-evaluate multiply 0 "${p}.png"
done
DEST="${1}"
PNGS=(
reload
reload@2
reload@4
O/digit_0
O/digit_1
O/digit_2
O/digit_3
O/digit_4
O/digit_5
O/digit_6
O/digit_7
O/digit_8
O/digit_9
O/digit_am
O/digit_pm
add_glow_small
ball_small_glow_intense
bg_glow_in
box_glow
bt_base
bt_sig_1
bt_sig_2
bulb_glow
cell_base
cell_sig_1
cell_sig_2
cell_sig_3
cell_sig_4
col_sel_end_bottom
col_sel_end_left
col_sel_end_right
col_sel_end_top
color_picker_color
day_left_press
day_left_selected
day_middle_press
day_middle_selected
day_right_press
day_right_selected
day_single_press
day_single_selected
diagonal_stripes
downlight_glow_left
downlight_glow
downlight_glow_right
downlight_glow_up
efm_generic_icon_over_empty
efm_generic_icon_over
glow_exclam
glow_lock_double
glow_lock_locked
glow_lock_unlocked
glow_round_corners
glow_round_corners_small
glow_small
handle_pick_up_left
handle_pick_up_right
holes_tiny_glow_horiz
holes_tiny_glow_vert
home_glow
horiz_glow_range
horiz_glow_run_big
horiz_glow_run
horiz_glow_run_rev
horizontal_separated_bar_glow
horizontal_separated_bar_small_glow
ic_win_move
ic_win_resize
icon_apps
icon_arrow_down_left
icon_arrow_down
icon_arrow_down_right
icon_arrow_left
icon_arrow_right
icon_arrow_up_left
icon_arrow_up
icon_arrow_up_right
icon_border_border
icon_border_close
icon_border_kill
icon_border_lock
icon_border_maximize
icon_border_minimize
icon_border_more
icon_border_move
icon_border_pager
icon_border_pin
icon_border_properties
icon_border_remember
icon_border_resize
icon_border_sendto
icon_border_shaded
icon_border_skip
icon_border_stack_bot
icon_border_stack_norm
icon_border_stack_top
icon_chat
icon_clock
icon_close
icon_delete
icon_edit
icon_eject
icon_enlightenment
icon_file
icon_folder
icon_forward
icon_head
icon_home
icon_info
icon_mute
icon_next
icon_pause
icon_play
icon_preferences-interaction
icon_preferences-variables
icon_prev
icon_refresh
icon_rewind
icon_search
icon_spanner
icon_splat_half
icon_splat
icon_stop
icon_system-lock-screen
icon_system-log-out
icon_system
icon_system-restart
icon_system-shutdown
icon_system-suspend-hibernate
icon_system-suspend
icon_volume
icon_warning
inset_bar_horiz_glow_base
inset_bar_horiz_glow_inv_base
inset_bar_horiz_glow_mid_base
inset_bar_vert_glow_base
inset_bar_vert_glow_inv_base
inset_bar_vert_glow_mid_base
kbd_glow
logo_blue_bottom
logo_blue_small_glow
logo_blue_small
media_busy_progress
mem_on
mem_on_vert
mini_blue_glow_arrow_0
mini_blue_glow_arrow_1
mini_blue_glow_arrow_2
mini_blue_glow_arrow_3
mini_box_glow
outline_glow
pointer_glow
ring_white_blue_glow
runner_glow_horiz
runner_glow_vert
spanner_glow
split_h_glow
split_none_glow
split_v_glow
sym_close_light_selected
sym_down_glow_normal
sym_down_light_selected
sym_heart_glow_normal
sym_heart_light_normal
sym_left_glow_normal
sym_reload_glow_normal
sym_right_glow_normal
sym_up_glow_normal
sym_up_light_selected
therm_content
vert_glow_range
vert_glow_run
vert_glow_run_rev
vertical_separated_bar_glow
white_bar_vert_glow
wifi_base
wifi_sig_1
wifi_sig_2
wifi_sig_3
win_glow
)
elif [[ "${1}" == "terminology" ]]; then
DEST="config/${1}"
PNGS=(
icon_about
icon_close
icon_copy
icon_miniview
icon_new
icon_paste
icon_split_h
icon_split_v
sl_stripe
)
fi
# Process pngs via imagemagick convert
local orig
for p in "${PNGS[@]}"; do
orig=".orig/${p}.png"
[[ ! -f "${orig}" ]] && mv "${p}.png" "${orig}"
convert "${orig}" -modulate "${HSB}" "${p}.png"
done
local name DIR
name="eminence-${1}"
if [[ ${INSTALL} ]]; then
DIR="${HOME}/.${DEST}/themes/"
name="eminence"
fi
edje_cc -id . -fd . eminence.edc -o \
"${DIR}${name}.edj" || exit 1
cleanup
}
cleanup
for e in "${EDJS[@]}"; do
process_edj "${e}"
done