-
Notifications
You must be signed in to change notification settings - Fork 6
/
build-darkmod.sh
executable file
·528 lines (438 loc) · 19.2 KB
/
build-darkmod.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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
#!/bin/bash
#####################################################################
# #
# darkmod - Enlightenment Dark theme modifier #
# #
# You should not modify this file directly all colors and paths #
# can be modified in darkmod-colors-paths.sh images that you #
# wish to modify manually can be placed in the img-manual #
# directory and they will be included over the existing images #
# #
#####################################################################
if [[ $1 == '--epkg' ]]; then
DKMD_EPKG=1
else
DKMD_EPKG=0
fi
if [[ $1 == '--termpkg' ]]; then
DKMD_TERMPKG=1
else
DKMD_TERMPKG=0
fi
hash edje_cc 2>/dev/null || { echo >&2 "I require edje_cc but it's not installed. Aborting."; exit 1; }
hash convert 2>/dev/null || { echo >&2 "I require the convert binary from imagemagick but it's not installed. Aborting."; exit 1; }
# load libraries
source darkmod-color-paths.conf
source darkmod-util.sh
source darkmod-copy.sh
source clean-darkmod.sh
# Other modifications
# battery.edc
# about-theme.edc
# dark rounded rect needs to be light
# filemanager icons
# menu text
# load from param
# everything shadows
inform "Cleaning Repository"
clean-darkmod $THEME_NAME
success " Finished Cleaning Repository"
if [[ $DKMD_TERMPKG != 1 ]]; then
inform "Creating a backup of all images"
mkdir $ELM_ENLIGHT_THEME_PATH/img-bak
mkdir $ELM_ENLIGHT_THEME_PATH/img-manual-bak
mkdir $ELM_ENLIGHT_THEME_PATH/fdo-bak
report_on_error cp -vr $ELM_ENLIGHT_THEME_PATH/img/* $ELM_ENLIGHT_THEME_PATH/img-bak
if [[ -f $ELM_ENLIGHT_THEME_PATH/$MANUAL_IMAGE_CONVD_DIR/$1 ]]; then
report_on_error cp -vr $ELM_ENLIGHT_THEME_PATH/img-manual-convd/* $ELM_ENLIGHT_THEME_PATH/img-manual-bak
fi
report_on_error cp -vr $ELM_ENLIGHT_THEME_PATH/fdo/* $ELM_ENLIGHT_THEME_PATH/fdo-bak
success " Finished Creating Backup"
inform "Moving images to be converted"
moveAllHighlightImages
moveAllBackgroundImages
moveAllShadowImages
success " Finished Moving images that need converting"
inform "Moving images that need no conversion"
mv $ELM_ENLIGHT_THEME_PATH/img $ELM_ENLIGHT_THEME_PATH/img-no-change
success " Finished Moving images that don't need converting"
mkdir $ELM_ENLIGHT_THEME_PATH/img-color-convd
inform "Converting images"
pushd $ELM_ENLIGHT_THEME_PATH/img-color &> /dev/null
for F in `find -iname "*.png"`; do
convert $F -modulate $HIGH_BRIGHTNESS,$HIGH_SATURATION,$HIGH_HUE ../img-color-convd/$F
done
popd &> /dev/null
HIGH_RAW=$(convert $ELM_ENLIGHT_THEME_PATH/img-color-convd/bg_glow_in.png -crop "1x1+0+0" txt:-)
#HIGH_HTML=$HIGH_RAW | sed -n 's/.*\(*#[0-9][0-9][0-9][0-9][0-9][0-9]*\).*/\1/p'
#remove most of the variable content
TMP_MID=$(echo "$HIGH_RAW"| cut -d "#" -f2)
#remove the remaining fixed content
TMP_EXTRACTED=${TMP_MID#${TMP_MID:0:46}}
#form the html number
HIGH_HTML="#${TMP_EXTRACTED:0:6}"
#form the rgb number
HIGH_HTML=$(convert $ELM_ENLIGHT_THEME_PATH/img-color-convd/bg_glow_in.png -crop "1x1+0+0" txt:- | awk 'match($0, /#[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]/) {print substr($0, RSTART, RLENGTH)}')
# Need the first bracket to match the right string so remove it after
HIGH_RGB=$(convert $ELM_ENLIGHT_THEME_PATH/img-color-convd/bg_glow_in.png -crop "1x1+0+0" txt:- | perl -e 'while(<STDIN>){if(/srgba\((\d+),(\d+),(\d+)/){print"$1,$2,$3\n"}}')
# Substitute , for " "
HIGH_RGB=$(echo "$HIGH_RGB" | tr "," " ")
set $HIGH_RGB
HIGH_RED=$1
HIGH_GREEN=$2
HIGH_BLUE=$3
#if we don't have a valid color error
if [[ -z "$HIGH_HTML" ]]; then
error "Highlight Color could not be determined"
# Move images back before exit
report_on_error mv -v img-bak img
report_on_error mv -v img-manual-bak/* img-manual-convd
exit 1
fi
if [[ -z "$HIGH_RGB" ]]; then
error "Highlight Color could not be determined"
# Move images back before exit
report_on_error mv -v img-bak img
report_on_error mv -v img-manual-bak/* img-manual-convd
exit 1
fi
if [[ -d "$ELM_ENLIGHT_THEME_PATH/img-color-manual" ]]; then
pushd $ELM_ENLIGHT_THEME_PATH/img-color-manual &> /dev/null
for F in `find -iname "*.png"`; do
convert $F -modulate $HIGH_BRIGHTNESS,$HIGH_SATURATION,$HIGH_HUE ../img-color-convd/$F
done
popd &> /dev/null
fi
# Converting background images
pushd $ELM_ENLIGHT_THEME_PATH/img-bgnd &> /dev/null
for F in `find -iname "*.png"`; do
convert $F -channel rgb -brightness-contrast $BGND_BRIGHTNESS,$BGND_SATURATION +channel ../img-color-convd/$F
done
popd &> /dev/null
#converting shadows
pushd $ELM_ENLIGHT_THEME_PATH/img-shadow &> /dev/null
for F in `find -iname "*.png"`; do
convert $F -channel A -evaluate Multiply $SHADOW_MULT ../img-color-convd/$F
# convert $F -channel A -evaluate set 20% ../img-color-convd/$F
# cp $F ../img-color-convd/$F
done
popd &> /dev/null
inform "Recoloring FDO icons"
# Recolor the fdo icon theme
for icon in $(cat darkmod-fdo-icon-recolor.txt); do
for F in `find $ELM_ENLIGHT_THEME_PATH/fdo -name "$icon.svg"`; do
sed -i "s/#3399ff/$HIGH_HTML/g" $F
done
for F in `find $ELM_ENLIGHT_THEME_PATH/fdo -name "$icon.png"`; do
convert $F -modulate $HIGH_BRIGHTNESS,$HIGH_SATURATION,$HIGH_HUE $F
done
done
mkdir -p "build/icons/"
clean_dir build/icons/$THEME_NAME-icons
cp -r $ELM_ENLIGHT_THEME_PATH/fdo build/icons/$THEME_NAME-icons
sed -i "s/Enlightenment-X/$THEME_NAME-e-X/g" "build/icons/$THEME_NAME-icons/index.theme"
success " Finished Converting Images"
inform "Rewriting .edc"
pushd $ELM_ENLIGHT_THEME_PATH &> /dev/null
report_on_error cp -a edc edc-dm
report_on_error cp -a colorclasses.edc colorclasses-dm.edc
report_on_error cp -a fonts.edc fonts-dm.edc
report_on_error cp -a macros.edc macros-dm.edc
# Replace background and highlights in edc
for F in `find edc-dm colorclasses-dm.edc macros-dm.edc -iname "*.edc"`; do
# Highlight color
if [[ "$HIGH_RGB" != "51 153 255" ]]; then
sed -i "s/51 153 255/$HIGH_RGB/g" $F
sed -i "s/#3399ff/$HIGH_HTML/g" $F
# for battery
sed -i "s/r = 51, g = 153, b = 255/r = $HIGH_RED, g = $HIGH_GREEN, b = $HIGH_BLUE/g" $F
fi
# File manager background
if [[ "$FILEMGR_BKND_RGB" != "64 64 64" ]]; then
sed -i "s/64 64 64/$FILEMGR_BKND_RGB/g" $F
sed -i "s/#404040/$FILEMGR_BKND_HTML/g" $F
fi
# file manager alt
if [[ "$FILEMGR_ALT_BKND_RGB" != "56 56 56" ]]; then
sed -i "s/56 56 56/$FILEMGR_ALT_BKND_RGB/g" $F
sed -i "s/#383838/$FILEMGR_ALT_BKND_HTML/g" $F
fi
# File manager image background
if [[ "$FILEMGR_IMG_BKND_RGB" != "48 48 48" ]]; then
sed -i "s/48 48 48/$FILEMGR_IMG_BKND_RGB/g" $F
sed -i "s/#303030/$FILEMGR_IMG_BKND_HTML/g" $F
fi
# Grey boxes in pager
if [[ "$FILEMGR_MID_GREY_RGB" != "50 50 50" ]]; then
sed -i "s/50 50 50/$FILEMGR_MID_GREY_RGB/g" $F
sed -i "s/#323232/$FILEMGR_MID_GREY_HTML/g" $F
fi
# Checkbox background (mostly for toggle)
if [[ "$TOGGLE_BKND_RGB" != "24 24 24" ]]; then
sed -i "s/24 24 24/$TOGGLE_BKND_RGB/g" $F
sed -i "s/#181818/$TOGGLE_BKND_HTML/g" $F
fi
# modify html versions of text for textblock
if [[ "$FNT_DEFAULT_HTML" != "#FFFFFF" ]]; then
sed -i "s/#ffffff/$FNT_DEFAULT_HTML/gI" $F
sed -i "s/#ffff/$FNT_DEFAULT_HTML/gI" $F
fi
if [[ "$FNT_DEFAULT_SHADOW_HTML" != "#00000080" ]]; then
sed -i "s/#00000080/$FNT_DEFAULT_SHADOW_HTML/gI" $F
fi
# Disabled text
if [[ "$FNT_DISABLED_HTML" != "#151515" ]]; then
sed -i "s/#151515/$FNT_DISABLED_HTML/g" $F
fi
if [[ "$FNT_DISABLED_SHADOW_HTML" != "#FFFFFF19" ]]; then
sed -i "s/#FFFFFF19/$FNT_DISABLED_SHADOW_HTML/gI" $F
fi
done
# replace text colors / yes this probably doesn't need a for loop
for F in `find fonts-dm.edc -iname "*.edc"`; do
# default text
if [[ "$FNT_DEFAULT_RGB" != "255 255 255" ]]; then
sed -i "s/255 255 255/$FNT_DEFAULT_RGB/g" $F
sed -i "s/#ffffff/$FNT_DEFAULT_HTML/gI" $F
sed -i "s/#ffff/$FNT_DEFAULT_HTML/gI" $F
fi
if [[ "$FNT_DEFAULT_SHADOW_RGB" != "0 0 0 128" ]]; then
sed -i "s/0 0 0 128/$FNT_DEFAULT_SHADOW_RGB/g" $F
sed -i "s/#00000080/$FNT_DEFAULT_SHADOW_HTML/gI" $F
fi
# Highlight color
if [[ "$HIGH_RGB" != "51 153 255" ]]; then
sed -i "s/51 153 255/$HIGH_RGB/g" $F
sed -i "s/#3399ff/$HIGH_HTML/g" $F
fi
# Disabled text
if [[ "$FNT_DISABLED_HTM" != "#151515" ]]; then
sed -i "s/21 21 21/$FNT_DISABLED_RGB/g" $F
sed -i "s/16 16 16 16/16 $FNT_DISABLED_RGB/g" $F
sed -i "s/#151515/$FNT_DISABLED_HTML/g" $F
fi
if [[ "$FNT_DISABLED_SHADOW_RG" != "255 255 255 25" ]]; then
sed -i "s/255 255 255 25\ns/$FNT_DISABLED_SHADOW_RGB\n/g " $F
sed -i "s/#FFFFFF19/$FNT_DISABLED_SHADOW_HTML/gI" $F
fi
# Various Grey text need 4 colors so it doesn't overwrite the name instead
sed -i "s/192 192 192 192/192 $FNT_GREY_192_RGB/g" $F
sed -i "s/172 172 172 172/172 $FNT_GREY_172_RGB/g" $F
sed -i "s/152 152 152 152/152 $FNT_GREY_152_RGB/g" $F
done
sed -i "s/Dark/$THEME_NAME/g" edc-dm/about-theme.edc
sed -i "s/The default theme for Enlightenment/$THEME_DESC/g" edc-dm/about-theme.edc
# #repair the definition of blue - used in startup leds
report_on_error sed -i 's/#define BLUE 152 205 87 255/#define BLUE 51 153 255 255/' edc-dm/init.edc
report_on_error cp -a default.edc default-dm.edc
report_on_error sed -i 's/"edc/"edc-dm/' default-dm.edc
report_on_error sed -i 's/"colorclasses/"colorclasses-dm/' default-dm.edc
report_on_error sed -i 's/"fonts/"fonts-dm/' default-dm.edc
report_on_error sed -i 's/"macros/"macros-dm/' default-dm.edc
success " Finished Writing .edc"
inform "Creating theme"
mkdir -p ../build/e
edje_cc -v -id $MANUAL_IMAGE_DIR -id img-color-convd -id img-no-change -fd fnt -sd snd default-dm.edc $ELM_ENLIGHT_AUTHORS $ELM_ENLIGHT_LICENSE ../build/e/$THEME_NAME.edj
report_on_error mv -v img-bak img
if [ -f $ELM_ENLIGHT_THEME_PATH/$MANUAL_IMAGE_CONVD_DIR/$1 ]; then
report_on_error mv -v img-manual-bak/* img-manual-convd
fi
clean_dir fdo
report_on_error mv -v fdo-bak fdo
if [[ -f ../build/e/$THEME_NAME.edj ]]; then
mkdir -p "../artifacts/bin-e"
cp "../build/e/$THEME_NAME.edj" "../artifacts/bin-e/"
if [[ $DKMD_EPKG != 1 && $DKMD_TERMPKG != 1 ]]; then
report_on_error install ../build/e/$THEME_NAME.edj ~/.elementary/themes
inform "Compressing Icon Theme"
mkdir -p ../artifacts/icons/
pushd ../build/icons/ &> /dev/null
report_on_error tar -cf "../../artifacts/icons/$THEME_NAME-$THEME_VERSION-icons.tar.xz" "$THEME_NAME-icons/"
popd &> /dev/null
inform "" # Lazy new line
inform "Enlightenment Theme Complete"
inform "" # Lazy new line
fi
else
error "build probably failed exiting"
exit 1
fi
popd &> /dev/null
fi
##############################################################################################################################
termColorschemes=("$THEME_NAME.eet")
if [[ -n "$TERMINOLOGY_THEME_PATH" ]];then
if [[ $DKMD_EPKG != 1 ]]; then
mkdir $TERMINOLOGY_THEME_PATH/img-bak
report_on_error cp -vr $TERMINOLOGY_THEME_PATH/images/* $TERMINOLOGY_THEME_PATH/img-bak
moveAllTerminologyHighlightImages
moveAllTerminologyBackgroundImages
moveAllTerminologyShadowImages
mv $TERMINOLOGY_THEME_PATH/images $TERMINOLOGY_THEME_PATH/img-no-change
success " Finished moving terminology images"
mkdir $TERMINOLOGY_THEME_PATH/img-color-convd
pushd $TERMINOLOGY_THEME_PATH/img-color &> /dev/null
for F in `find -iname "*.png"`; do
convert $F -modulate $HIGH_BRIGHTNESS,$HIGH_SATURATION,$HIGH_HUE ../img-color-convd/$F
done
popd &> /dev/null
if [[ -d "$TERMINOLOGY_THEME_PATH/img-color-manual" ]]; then
pushd $TERMINOLOGY_THEME_PATH/img-color-manual &> /dev/null
for F in `find -iname "*.png"`; do
convert $F -modulate $HIGH_BRIGHTNESS,$HIGH_SATURATION,$HIGH_HUE ../img-color-convd/$F
done
popd &> /dev/null
fi
# Converting background images
pushd $TERMINOLOGY_THEME_PATH/img-bgnd &> /dev/null
for F in `find -iname "*.png"`; do
convert $F -brightness-contrast $BGND_BRIGHTNESS,$BGND_SATURATION ../img-color-convd/$F
done
popd &> /dev/null
#converting shadows
pushd $TERMINOLOGY_THEME_PATH/img-shadow &> /dev/null
for F in `find -iname "*.png"`; do
convert $F -channel A -evaluate Multiply $SHADOW_MULT ../img-color-convd/$F
done
popd &> /dev/null
if [[ $DKMD_TERMPKG == 1 ]]; then
HIGH_RAW=$(convert $TERMINOLOGY_THEME_PATH/img-color-convd/bg_glow_in.png -crop "1x1+0+0" txt:-)
#HIGH_HTML=$HIGH_RAW | sed -n 's/.*\(*#[0-9][0-9][0-9][0-9][0-9][0-9]*\).*/\1/p'
#remove most of the variable content
TMP_MID=$(echo "$HIGH_RAW"| cut -d "#" -f2)
#remove the remaining fixed content
TMP_EXTRACTED=${TMP_MID#${TMP_MID:0:46}}
#form the html number
HIGH_HTML="#${TMP_EXTRACTED:0:6}"
HIGH_HTML=$(convert $TERMINOLOGY_THEME_PATH/img-color-convd/bg_glow_in.png -crop "1x1+0+0" txt:- | awk 'match($0, /#[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]/) {print substr($0, RSTART, RLENGTH)}')
#form the rgb number
# Need the first bracket to match the right string so remove it after
HIGH_RGB=$(convert $TERMINOLOGY_THEME_PATH/img-color-convd/bg_glow_in.png -crop "1x1+0+0" txt:- | perl -e 'while(<STDIN>){if(/srgba\((\d+),(\d+),(\d+)/){print"$1,$2,$3\n"}}')
# Substitute , for " "
HIGH_RGB=$(echo "$HIGH_RGB" | tr "," " ")
fi
# Convert theme svg Images
pushd $TERMINOLOGY_THEME_PATH/img-color &> /dev/null
for F in `find . -iname "*.svg"`; do
sed "s/#3399ff/$HIGH_HTML/g" $F > ../img-color-convd/$F
done
popd &> /dev/null
pushd $TERMINOLOGY_THEME_PATH &> /dev/null
report_on_error cp -a default.edc default-dm.edc
report_on_error cp -a Default.ini Default-dm.ini
report_on_error sed -i "s/"default/"default-dm/" default-dm.edc
report_on_error cp -a default default-dm
# Replace background and highlights in edc
for F in `find default-dm default-dm.edc Default-dm.ini \( -iname "*.edc" -o -iname "*.ini" \)`; do
# Highlight color
if [[ "$HIGH_RGB" != "51 153 255" ]]; then
sed -i "s/51 153 255/$HIGH_RGB/g" $F
sed -i "s/#3399ff/$HIGH_HTML/g" $F
sed -i "s/r = 51, g = 153, b = 255/r = $HIGH_RED, g = $HIGH_GREEN, b = $HIGH_BLUE/g" $F
fi
# File manager background
if [[ "$FILEMGR_BKND_RGB" != "64 64 64" ]]; then
sed -i "s/64 64 64/$FILEMGR_BKND_RGB/g" $F
sed -i "s/#404040/$FILEMGR_BKND_HTML/g" $F
fi
# file manager alt
if [[ "$FILEMGR_ALT_BKND_RGB" != "56 56 56" ]]; then
sed -i "s/56 56 56/$FILEMGR_ALT_BKND_RGB/g" $F
sed -i "s/#383838/$FILEMGR_ALT_BKND_HTML/g" $F
fi
# File manager image background
if [[ "$FILEMGR_IMG_BKND_RGB" != "48 48 48" ]]; then
sed -i "s/48 48 48/$FILEMGR_IMG_BKND_RGB/g" $F
sed -i "s/#303030/$FILEMGR_IMG_BKND_HTML/g" $F
fi
# Grey boxes in pager
if [[ "$FILEMGR_MID_GREY_RGB" != "50 50 50" ]]; then
sed -i "s/50 50 50/$FILEMGR_MID_GREY_RGB/g" $F
sed -i "s/#323232/$FILEMGR_MID_GREY_HTML/g" $F
fi
# modify html versions of text for textblock
if [[ "$FNT_DEFAULT_HTML" != "#ffffff" ]]; then
sed -i "s/#ffffff/$FNT_DEFAULT_HTML/gI" $F
sed -i "s/#ffff/$FNT_DEFAULT_HTML/gI" $F
fi
if [[ "$FNT_DEFAULT_SHADOW_HTML" != "#00000080" ]]; then
sed -i "s/#00000080/$FNT_DEFAULT_SHADOW_HTML/gI" $F
fi
# Disabled text
if [[ "$FNT_DISABLED_HTML" != "#151515" ]]; then
sed -i "s/#151515/$FNT_DISABLED_HTML/g" $F
fi
if [[ "$FNT_DISABLED_SHADOW_HTML" != "#FFFFFF19" ]]; then
sed -i "s/#FFFFFF19/$FNT_DISABLED_SHADOW_HTML/gI" $F
fi
#terminology background
if [[ "$TERMINOLOGY_BACKGROUND" != "#202020" ]]; then
sed -i "s/#202020/$TERMINOLOGY_BACKGROUND/g" $F
fi
done
# Some extra colorscheme
sed -i "s/Default/$THEME_NAME/g" Default-dm.ini
sed -i "s/Terminology's developers,/$THEME_AUTHOR/g" Default-dm.ini
sed -i "s/https:////www.enlightenment.org//about-terminology/$THEME_WEB/g" Default-dm.ini
mkdir -p ../build/term
edje_cc -v -id $MANUAL_IMAGE_DIR -id img-color-convd -id img-no-change -sd sounds default-dm.edc $TERMINOLOGY_LICENSE $TERMINOLOGY_AUTHORS ../build/term/$THEME_NAME.edj
report_on_error mv -v img-bak images
if [[ $DKMD_TERMPKG != 1 ]]; then
if [[ ! -d ~/.config/terminology/colorschemes ]]; then
mkdir ~/.config/terminology/colorschemes
fi
fi
inform "Creating Color Scheme"theme
mkdir -p "../artifacts/bin-term"
# Use any name thats not the default if it exists otherwise fall back to the recolored default
INI_COUNT=$(ls -l *ini | grep -v "Default" | wc -l)
if [[ $INI_COUNT > 0 ]]; then
for f in $(ls *.ini); do
if [[ $f != "Default-dm.ini" && $f != "Default.ini" ]]; then
./add_color_scheme.sh "eet" "../build/term/${f%.*}.eet" "$f"
cp "../build/term/${f%.*}.eet" "../artifacts/bin-term/"
if [[ $f != "$THEME_NAME.eet" ]]; then
termColorschemes+=("${f%.*}.eet")
fi
fi
done
else
./add_color_scheme.sh "eet" "../build/term/$THEME_NAME.eet" "Default-dm.ini"
fi
if [[ ! -f ../build/term/$THEME_NAME.edj || ! -f ../build/term/$THEME_NAME.eet ]]; then
error "Terminology theme or colorscheme not found build probably failed exiting"
exit 1
fi
cp "../build/term/$THEME_NAME.edj" "../artifacts/bin-term/"
rm *-EET-*
if [[ $DKMD_TERMPKG != 1 ]]; then
report_on_error cp ../build/term/$THEME_NAME.edj ~/.config/terminology/themes
for c in "${termColorschemes[@]}"; do
report_on_error cp "../build/term/$c" ~/.config/terminology/colorschemes/
done
fi
popd &> /dev/null # Terminology theme dir
fi
fi
if [[ $DKMD_EPKG = 0 && $DKMD_TERMPKG = 0 ]]; then
inform "Creating Bundle"
# Create Bundle
pushd build &> /dev/null
# Be Nice Copy Everything to a dir first.
mkdir -p "$THEME_NAME-$THEME_VERSION-Bundle/e"
mkdir -p "$THEME_NAME-$THEME_VERSION-Bundle/term"
cp "../local-install.sh" "$THEME_NAME-$THEME_VERSION-Bundle/install.sh"
sed -i "s/PLACEHOLDER/$THEME_NAME/g" "$THEME_NAME-$THEME_VERSION-Bundle/install.sh"
cp "e/$THEME_NAME.edj" "$THEME_NAME-$THEME_VERSION-Bundle/e/"
cp "term/$THEME_NAME.edj" "$THEME_NAME-$THEME_VERSION-Bundle/term/"
for c in "${termColorschemes[@]}"; do
cp "term/$c" "$THEME_NAME-$THEME_VERSION-Bundle/term/"
done
cp -r "icons/$THEME_NAME-icons/" "$THEME_NAME-$THEME_VERSION-Bundle"
mkdir -p "../artifacts/bundle/"
report_on_error tar -cf "../artifacts/bundle/$THEME_NAME-$THEME_VERSION-Bundle.tar.xz" "$THEME_NAME-$THEME_VERSION-Bundle"
rm -r "$THEME_NAME-$THEME_VERSION-Bundle"
popd &> /dev/null
# TBD: copy back to current dir, and to .e file
fi
inform "Completed at: " $(date)