-
Notifications
You must be signed in to change notification settings - Fork 4
/
Celeste Classic.sh
55 lines (40 loc) · 1.16 KB
/
Celeste Classic.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
#!/bin/bash
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
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"
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
controlfolder="$XDG_DATA_HOME/PortMaster"
else
controlfolder="/roms/ports/PortMaster"
fi
source $controlfolder/control.txt
if [ -z ${TASKSET+x} ]; then
source $controlfolder/tasksetter
fi
get_controls
## TODO: Change to PortMaster/tty when Johnnyonflame merges the changes in,
CUR_TTY=/dev/tty0
PORTDIR="/$directory/ports"
#GAMEDIR="$PORTDIR/ccleste"
SHDIR=$(dirname "$0")
GAMEDIR="$SHDIR/ccleste"
cd $GAMEDIR
$ESUDO chmod 666 /dev/uinput
$ESUDO chmod 666 $CUR_TTY
$ESUDO touch log.txt
$ESUDO chmod 666 log.txt
export TERM=linux
printf "\033c" > $CUR_TTY
## RUN SCRIPT HERE
echo "Starting game." > $CUR_TTY
$GPTOKEYB "ccleste" -c ccleste.gptk &
$TASKSET ./ccleste 2>&1 | $ESUDO tee -a ./log.txt
$ESUDO kill -9 $(pidof gptokeyb)
unset LD_LIBRARY_PATH
unset SDL_GAMECONTROLLERCONFIG
$ESUDO systemctl restart oga_events &
# Disable console
printf "\033c" > $CUR_TTY