summaryrefslogtreecommitdiffstats
path: root/abs/extra/community/dolphin-emu/dolphin-emu_scan.sh
diff options
context:
space:
mode:
authorCecil <knoppmyth@gmail.com>2012-06-10 09:20:22 (GMT)
committerCecil <knoppmyth@gmail.com>2012-06-10 09:20:22 (GMT)
commit2a94d52b081284e7f8165948fae50b3efabcd625 (patch)
treeffde052c683f889fc73b1865c0ce1d4c3722927e /abs/extra/community/dolphin-emu/dolphin-emu_scan.sh
parent5011a58602b07baa129e2df183f7e0bb8996f092 (diff)
downloadlinhes_pkgbuild-2a94d52b081284e7f8165948fae50b3efabcd625.zip
linhes_pkgbuild-2a94d52b081284e7f8165948fae50b3efabcd625.tar.gz
linhes_pkgbuild-2a94d52b081284e7f8165948fae50b3efabcd625.tar.bz2
dolphin-emu:Added menu entry for Dolphin. Added script that parse directory to create menu entry for games.
Diffstat (limited to 'abs/extra/community/dolphin-emu/dolphin-emu_scan.sh')
-rw-r--r--abs/extra/community/dolphin-emu/dolphin-emu_scan.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/abs/extra/community/dolphin-emu/dolphin-emu_scan.sh b/abs/extra/community/dolphin-emu/dolphin-emu_scan.sh
new file mode 100644
index 0000000..615cac8
--- /dev/null
+++ b/abs/extra/community/dolphin-emu/dolphin-emu_scan.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+#----------------------------------------------------------------------------
+. /etc/osd_cat.cfg || {
+ color=yellow
+ outline=2
+ outlinecolour=black
+ shadow=0
+ shadowcolour=black
+ font="-adobe-helvetica-bold-*-*-*-34-*-*-*-*-*-*-*"
+}
+#----------------------------------------------------------------------------
+EXTNS=('[eE][lL][fF]' '[dD][oO][lL]' '[gG][cC][mM]' '[iI][sS][oO]' '[cC][iI][sS][oO]' '[gG][cC][zZ]' '[wW][aA][dD]')
+DIR=/myth/games/dolphin-emu/roms
+rm -fr /tmp/dolphin*
+echo -e "Scanning for games and creating menu." | osd_cat --pos=middle --align=center --delay=3 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font &
+for EXT in ${EXTNS[@]}
+do
+ if [ -d "$DIR" ]; then
+ cd $DIR
+ ls *.$EXT >> /tmp/dolphin-emu.games
+ fi
+done
+echo "<mythmenu name=\"DOLPHIN\">" > /tmp/dolphin-emu_games.xml
+
+while read line
+do
+ echo " <button>" >> /tmp/dolphin-emu_games.xml
+ echo " <type>MENU_DOLPHIN</type>" >> /tmp/dolphin-emu_games.xml
+ echo " <text>$(echo "$line" | sed 's/.\{4\}$//')</text>" >> /tmp/dolphin-emu_games.xml
+ echo " <action>EXEC /usr/bin/dolphin-emu -b -e $DIR/"$line"</action>" >> /tmp/dolphin-emu_games.xml
+ echo " </button>" >> /tmp/dolphin-emu_games.xml
+done < /tmp/dolphin-emu.games
+echo "</mythmenu>" >> /tmp/dolphin-emu_games.xml
+sudo mv /tmp/dolphin-emu_games.xml /usr/share/mythtv/themes/defaultmenu/