Advertisement
ExampleWhoexample

Fallout 2.sh

Jul 16th, 2024
51
0
205 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.47 KB | Gaming | 0 0
  1. #!/bin/bash
  2. # Built from https://github.com/alexbatalov/fallout2-ce
  3.  
  4. PORTNAME="Fallout 2"
  5. export HOME=/root
  6.  
  7. XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
  8.  
  9. if [ -d "/opt/system/Tools/PortMaster/" ]; then
  10.   controlfolder="/opt/system/Tools/PortMaster"
  11. elif [ -d "/opt/tools/PortMaster/" ]; then
  12.   controlfolder="/opt/tools/PortMaster"
  13. elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
  14.   controlfolder="$XDG_DATA_HOME/PortMaster"
  15. else
  16.   controlfolder="/roms/ports/PortMaster"
  17. fi
  18.  
  19. SHDIR=$(dirname "$0")
  20.  
  21. source $controlfolder/control.txt
  22. get_controls
  23.  
  24. CUR_TTY=/dev/tty0
  25. $ESUDO chmod 666 $CUR_TTY
  26.  
  27. GAMEDIR="$SHDIR/fallout2"
  28. cd "$GAMEDIR"
  29. echo "--directory=$directory---,HOTKEY=$HOTKEY--"
  30.  
  31. for f in data critter.dat master.dat patch000.dat; do
  32.     if [[ ! -e "$f" ]]; then
  33.         echo "Missing file: $f" > $CUR_TTY
  34.         echo "Missing file: $f" >> ./log.txt
  35.         sleep 5
  36.         $ESUDO systemctl restart oga_events &
  37.         printf "\033c" >> $CUR_TTY
  38.         exit 1
  39.     fi
  40. done
  41.  
  42. $ESUDO chmod 666 /dev/uinput
  43. export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
  44. echo "./fallout2.gptk.$ANALOGSTICKS" >> ./log.txt
  45. $GPTOKEYB "fallout2-ce" -c "./fallout2.gptk.$ANALOGSTICKS" -hotkey back &
  46.  
  47. if [[ $whichos == *"ArkOS"* ]]; then
  48.   LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.10.0 ./fallout2-ce 2>&1 | tee -a ./log.txt
  49. else
  50.   ./fallout2-ce 2>&1 | tee -a ./log.txt
  51. fi
  52.  
  53. $ESUDO kill -9 $(pidof gptokeyb)
  54. $ESUDO systemctl restart oga_events &
  55. printf "\033c" >> /dev/tty0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement