-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy paththeme.sh
executable file
·81 lines (67 loc) · 1.75 KB
/
theme.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
#!/bin/bash
#---------------------------------
# Styles
#---------------------------------
source styles.sh
PREFIXES=("background" "banner" "logo")
SYSTEMS=("2600" "col" "collections" "doom" "favorite" "gb" "gbc" "gg" "gw" "lnx" "md" "nes" "ngp" "pce" "recent" "sms" "snes" "themes")
SIZES=("320x240" "274x24" "46x50")
BACKGROUNDS=("white" "magenta" "black" "transparent")
BACKGROUND
LINE="=======================================================\n"
MESSAGE="\n${bold}${game} ${red}T${green}h${blue}e${magenta}m${cyan}e${white} Creator${nc}\n"
MESSAGE="${MESSAGE}\n"
MESSAGE="${MESSAGE}"
background() {
clear
echo -e "${LINE}${MESSAGE}${LINE}"
echo -e "Select a background color:"
select BACKGROUND in "${BACKGROUNDS[@]}"
do
case $BACKGROUND in
* )
if [[ $BACKGROUND[0,1] ]]
then
clear
echo -e "${LINE}${MESSAGE}${LINE}"
echo -e "Select a background color: ${BACKGROUND}"
break
else
background
fi
esac
done
}
clear
echo -e "${LINE}${MESSAGE}${LINE}"
echo -e "Are you ready to create a custom theme? [y/${bold}${white}N${nc}]"
read -n 1 -r response
if [[ "$response" = "y" ]]
then
clear
echo -e "${LINE}${MESSAGE}${LINE}"
echo -e "Please enter a theme name:"
read theme
clear
echo -e "${LINE}${MESSAGE}${LINE}"
echo -e "Creating theme with name: ${theme}"
mkdir themes/${theme}
cd themes/${theme}
background
for i in "${!PREFIXES[@]}";
do
PREFIX=${PREFIXES[i]}
SIZE=${SIZES[i]}
for SYSTEM in "${SYSTEMS[@]}"
do
FILE="${PREFIX}_${SYSTEM}"
convert -size ${SIZE} canvas:${BACKGROUND} PNG32:${FILE}.png
done
done
clear
echo -e "${LINE}${MESSAGE}${LINE}"
echo -e "Thank you!"
else
clear
exit
fi