forked from jxded/anbernic-pm-launchscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSonic Robo Blast 2 Kart.sh
38 lines (29 loc) · 975 Bytes
/
Sonic Robo Blast 2 Kart.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
#!/bin/bash
export HOME=/root
if [ -d "/opt/system/Tools/PortMaster/" ]; then
controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/" ]; then
controlfolder="/opt/tools/PortMaster"
else
controlfolder="/roms/ports/PortMaster"
fi
SHDIR="$(cd $(dirname "$0"); pwd)"
source $controlfolder/control.txt
get_controls
GAMEDIR="$SHDIR/srb2kart"
if [[ $param_device == 'anbernic' ]]; then
gptk_file="srb2kart.anbernic.gptk"
if [[ -e $GAMEDIR/.srb2kart/kartconfig.cfg.anbernic ]]; then
mv -f $GAMEDIR/.srb2kart/kartconfig.cfg.anbernic $GAMEDIR/.srb2kart/kartconfig.cfg
fi
else
gptk_file="srb2kart.gptk"
if [[ -e $GAMEDIR/.srb2kart/kartconfig.cfg.anbernic ]]; then
rm -f $GAMEDIR/.srb2kart/kartconfig.cfg.anbernic
fi
fi
cd $GAMEDIR
$ESUDO chmod 666 /dev/uinput
$GPTOKEYB "srb2kart" -c "./$gptk_file" &
LD_LIBRARY_PATH=./libs:$LD_LIBRARY_PATH SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" ./srb2kart
$ESUDO kill -9 $(pidof gptokeyb)