/
esthemes.sh
324 lines (315 loc) · 10.9 KB
/
esthemes.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
#!/usr/bin/env bash
# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#
rp_module_id="esthemes"
rp_module_desc="Install themes for Emulation Station"
rp_module_section="config"
function depends_esthemes() {
if isPlatform "x11"; then
getDepends feh
else
getDepends fbi
fi
}
function install_theme_esthemes() {
local theme="$1"
local repo="$2"
if [[ -z "$repo" ]]; then
repo="RetroPie"
fi
if [[ -z "$theme" ]]; then
theme="carbon"
repo="RetroPie"
fi
mkdir -p "/etc/emulationstation/themes"
gitPullOrClone "/etc/emulationstation/themes/$theme" "https://github.com/$repo/es-theme-$theme.git"
}
function uninstall_theme_esthemes() {
local theme="$1"
if [[ -d "/etc/emulationstation/themes/$theme" ]]; then
rm -rf "/etc/emulationstation/themes/$theme"
fi
}
function gui_esthemes() {
local themes=(
'RetroPie carbon'
'RetroPie carbon-centered'
'RetroPie carbon-nometa'
'RetroPie simple'
'RetroPie simple-dark'
'RetroPie clean-look'
'RetroPie color-pi'
'RetroPie nbba'
'RetroPie simplified-static-canela'
'RetroPie turtle-pi'
'RetroPie zoid'
'ehettervik pixel'
'ehettervik pixel-metadata'
'ehettervik pixel-tft'
'ehettervik luminous'
'ehettervik minilumi'
'ehettervik workbench'
'AmadhiX eudora'
'AmadhiX eudora-bigshot'
'AmadhiX eudora-concise'
'InsecureSpike retroplay-clean-canela'
'InsecureSpike retroplay-clean-detail-canela'
'Omnija simpler-turtlepi'
'Omnija simpler-turtlemini'
'Omnija metro'
'lilbud material'
'mattrixk io'
'mattrixk metapixel'
'mattrixk spare'
'robertybob space'
'robertybob simplebigart'
'robertybob tv'
'HerbFargus tronkyfran'
'lilbud flat'
'lilbud flat-dark'
'lilbud minimal'
'lilbud switch'
'lilbud angular'
'FlyingTomahawk futura-V'
'FlyingTomahawk futura-dark-V'
'G-rila fundamental'
'ruckage nes-mini'
'ruckage famicom-mini'
'ruckage snes-mini'
'anthonycaccese crt'
'anthonycaccese crt-centered'
'anthonycaccese art-book'
'anthonycaccese art-book-4-3'
'anthonycaccese art-book-pocket'
'anthonycaccese art-book-micro'
'anthonycaccese tft'
'anthonycaccese picade'
'TMNTturtleguy ComicBook'
'TMNTturtleguy ComicBook_4-3'
'TMNTturtleguy ComicBook_SE-Wheelart'
'TMNTturtleguy ComicBook_4-3_SE-Wheelart'
'ChoccyHobNob cygnus'
'dmmarti steampunk'
'dmmarti hurstyblue'
'dmmarti maximuspie'
'dmmarti showcase'
'dmmarti kidz'
'dmmarti unified'
'dmmarti gamehat'
'rxbrad freeplay'
'rxbrad gbz35'
'rxbrad gbz35-dark'
'garaine marioblue'
'garaine bigwood'
'MrTomixf Royal_Primicia'
'lostless playstation'
'mrharias superdisplay'
'coinjunkie synthwave'
'nickearl retrowave'
'nickearl retrowave_4_3'
'pacdude minijawn'
'RetroHursty69 magazinemadness'
'RetroHursty69 stirling'
'RetroHursty69 boxalloyred'
'RetroHursty69 boxalloyblue'
'RetroHursty69 greenilicious'
'RetroHursty69 retroroid'
'RetroHursty69 merryxmas'
'RetroHursty69 cardcrazy'
'RetroHursty69 license2game'
'RetroHursty69 comiccrazy'
'RetroHursty69 snazzy'
'RetroHursty69 tributeGoT'
'RetroHursty69 tributeSTrek'
'RetroHursty69 tributeSWars'
'RetroHursty69 crisp'
'RetroHursty69 crisp_light'
'RetroHursty69 primo'
'RetroHursty69 primo_light'
'RetroHursty69 back2basics'
'RetroHursty69 retrogamenews'
'RetroHursty69 bluray'
'RetroHursty69 soda'
'RetroHursty69 lightswitch'
'RetroHursty69 darkswitch'
'RetroHursty69 whiteslide'
'RetroHursty69 graffiti'
'RetroHursty69 whitewood'
'RetroHursty69 sublime'
'RetroHursty69 infinity'
'RetroHursty69 neogeo_only'
'RetroHursty69 boxcity'
'RetroHursty69 vertical_arcade'
'RetroHursty69 cabsnazzy'
'RetroHursty69 garfieldism'
'RetroHursty69 halloweenspecial'
'RetroHursty69 heychromey'
'RetroHursty69 homerism'
'RetroHursty69 spaceinvaders'
'RetroHursty69 disenchantment'
'RetroHursty69 minions'
'RetroHursty69 tmnt'
'RetroHursty69 pacman'
'RetroHursty69 dragonballz'
'RetroHursty69 minecraft'
'RetroHursty69 incredibles'
'RetroHursty69 mario_melee'
'RetroHursty69 evilresident'
'RetroHursty69 hurstyspin'
'RetroHursty69 cyber'
'RetroHursty69 supersweet'
'RetroHursty69 donkeykonkey'
'RetroHursty69 snapback'
'RetroHursty69 heman'
'RetroHursty69 pitube'
'RetroHursty69 batmanburton'
'RetroHursty69 NegativeColor'
'RetroHursty69 NegativeSepia'
'RetroHursty69 corg'
'RetroHursty69 mysticorb'
'RetroHursty69 joysticks'
'RetroHursty69 orbpilot'
'RetroHursty69 bitfit'
'RetroHursty69 circuit'
'RetroHursty69 retroboy'
'RetroHursty69 retroboy2'
'RetroHursty69 hurstybluetake2'
'RetroHursty69 fabuloso'
'RetroHursty69 arcade1up_aspectratio54'
'RetroHursty69 supersweet_aspectratio54'
'RetroHursty69 heychromey_aspectratio54'
'RetroHursty69 mariobrosiii'
'RetroHursty69 vertical_limit_verticaltheme'
'RetroHursty69 CapcomColorHorizontal'
'RetroHursty69 CapcomColorSpin'
'RetroHursty69 CapcomColorVertical'
'RetroHursty69 bluesteel'
'RetroHursty69 blueprism'
'RetroHursty69 bluesmooth'
'RetroHursty69 floyd'
'RetroHursty69 floyd_arcade'
'RetroHursty69 floyd_room'
'RetroHursty69 Slick_Bluey'
'RetroHursty69 Slick_Red'
'RetroHursty69 ghostbusters'
'RetroHursty69 realghostbusters'
'RetroHursty69 stirlingness'
'RetroHursty69 marco'
'RetroHursty69 swatch'
'RetroHursty69 meshy'
'RetroHursty69 magazinemadness2'
'RetroHursty69 CosmicRise'
'RetroHursty69 uniflyered'
'Saracade scv720'
'chicueloarcade Chicuelo'
'SuperMagicom nostalgic'
'lipebello retrorama'
'lipebello strangerstuff'
'lipebello spaceoddity'
'lipebello swineapple'
'waweedman pii-wii'
'waweedman Blade-360'
'waweedman Venom'
'waweedman Spider-Man'
'blowfinger77 locomotion'
'justincaseurskynet Arcade1up-5x4-Horizontal'
'KALEL1981 Super-Retroboy'
)
while true; do
local theme
local installed_themes=()
local repo
local options=()
local status=()
local default
local gallerydir="/etc/emulationstation/es-theme-gallery"
if [[ -d "$gallerydir" ]]; then
status+=("i")
options+=(G "View or Update Theme Gallery")
else
status+=("n")
options+=(G "Download Theme Gallery")
fi
options+=(U "Update all installed themes")
local i=1
for theme in "${themes[@]}"; do
theme=($theme)
repo="${theme[0]}"
theme="${theme[1]}"
if [[ -d "/etc/emulationstation/themes/$theme" ]]; then
status+=("i")
options+=("$i" "Update or Uninstall $repo/$theme (installed)")
installed_themes+=("$theme $repo")
else
status+=("n")
options+=("$i" "Install $repo/$theme")
fi
((i++))
done
local cmd=(dialog --default-item "$default" --backtitle "$__backtitle" --menu "Choose an option" 22 76 16)
local choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
default="$choice"
[[ -z "$choice" ]] && break
case "$choice" in
G)
if [[ "${status[0]}" == "i" ]]; then
options=(1 "View Theme Gallery" 2 "Update Theme Gallery" 3 "Remove Theme Gallery")
cmd=(dialog --backtitle "$__backtitle" --menu "Choose an option for gallery" 12 40 06)
local choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
case "$choice" in
1)
cd "$gallerydir"
if isPlatform "x11"; then
feh --info "echo %f" --slideshow-delay 6 --fullscreen --auto-zoom --filelist images.list
else
fbi --timeout 6 --once --autozoom --list images.list
fi
;;
2)
gitPullOrClone "$gallerydir" "https://github.com/wetriner/es-theme-gallery"
;;
3)
if [[ -d "$gallerydir" ]]; then
rm -rf "$gallerydir"
fi
;;
esac
else
gitPullOrClone "$gallerydir" "http://github.com/wetriner/es-theme-gallery"
fi
;;
U)
for theme in "${installed_themes[@]}"; do
theme=($theme)
rp_callModule esthemes install_theme "${theme[0]}" "${theme[1]}"
done
;;
*)
theme=(${themes[choice-1]})
repo="${theme[0]}"
theme="${theme[1]}"
if [[ "${status[choice]}" == "i" ]]; then
options=(1 "Update $repo/$theme" 2 "Uninstall $repo/$theme")
cmd=(dialog --backtitle "$__backtitle" --menu "Choose an option for theme" 12 40 06)
local choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
case "$choice" in
1)
rp_callModule esthemes install_theme "$theme" "$repo"
;;
2)
rp_callModule esthemes uninstall_theme "$theme"
;;
esac
else
rp_callModule esthemes install_theme "$theme" "$repo"
fi
;;
esac
done
}