-
Notifications
You must be signed in to change notification settings - Fork 0
/
Duke Nukem 3D.sh
49 lines (43 loc) · 2 KB
/
Duke Nukem 3D.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
#!/bin/bash
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
source $controlfolder/control.txt
get_controls
GAMEDIR=/$directory/ports/rednukem-dn3d-atomic
# if [[ ! -e $GAMEDIR/conf/rednukem/rednukem.cfg ]]; then
if [[ $LOWRES == 'Y' && $ANALOGSTICKS == '1' ]]; then
mv -f $GAMEDIR/conf/rednukem/rednukem.cfg.480 $GAMEDIR/conf/rednukem/rednukem.cfg
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.640
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.480.2analogs
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.640.2analogs
elif [[ $LOWRES == 'Y' && $ANALOGSTICKS == '2' ]]; then
mv -f $GAMEDIR/conf/rednukem/rednukem.cfg.480.2analogs $GAMEDIR/conf/rednukem/rednukem.cfg
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.640
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.480
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.640.2analogs
elif [[ $LOWRES == 'N' && $ANALOGSTICKS == '1' ]]; then
mv -f $GAMEDIR/conf/rednukem/rednukem.cfg.640 $GAMEDIR/conf/rednukem/rednukem.cfg
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.480
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.480.2analogs
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.640.2analogs
elif [[ $LOWRES == 'N' && $ANALOGSTICKS == '2' ]]; then
mv -f $GAMEDIR/conf/rednukem/rednukem.cfg.640.2analogs $GAMEDIR/conf/rednukem/rednukem.cfg
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.480
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.480.2analogs
rm -f $GAMEDIR/conf/rednukem/rednukem.cfg.640
fi
# fi
$ESUDO rm -rf ~/.config/rednukem
$ESUDO ln -s $GAMEDIR/conf/rednukem ~/.config/
cd $GAMEDIR
$ESUDO chmod 666 /dev/uinput
$GPTOKEYB "rednukem" &
LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" ./rednukem -game_dir $GAMEDIR/gamedata 2>&1 | tee ./log.txt
$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" >> /dev/tty1