client-wrapper 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/bash
  2. set -eu -o pipefail
  3. helpexit() {
  4. echo "$0 start|stop|killwineserver|wineconfig"
  5. exit 1
  6. }
  7. test -n "${1:-}" || helpexit
  8. action=$1
  9. WINECONFIG=$HOME/.local/share/paimon-launcher/wineconfig.sh
  10. if [ ! -e "$WINECONFIG" ]; then
  11. cat > "$WINECONFIG" <<-EOF
  12. # config file for wine
  13. echo "Using $WINECONFIG, feel free to adjust it for your needs"
  14. # don't spam to console
  15. export WINEDEBUG=-all
  16. # use eSync - may improve frame rate with wine-stating signifacantly
  17. export WINEESYNC=1
  18. # uncomment to draw FPS in game
  19. # export DXVK_HUD=fps
  20. # setup path to wine bin dir here, leave empty to autodetect winehq installation
  21. # examples:
  22. # WINEPATH=/opt/wine-devel/bin
  23. # WINEPATH="\$HOME/.steam/steam/steamapps/common/Proton - Experimental"
  24. WINEPATH=
  25. # game launch command
  26. #WINESTARTCMD="proton cmd /c launcher.bat"
  27. WINESTARTCMD="wine cmd /c launcher.bat"
  28. # alternative command line with explorer desktop
  29. #WINESTARTCMD="wine explorer /desktop=anyname,1920x1080 cmd /c launcher.bat"
  30. # command to stop game
  31. WINESTOPCMD="killall *.exe"
  32. # kill wine server command
  33. KILLWINESERVER="wineserver -k"
  34. EOF
  35. fi
  36. if [ "$action" = "wineconfig" ]; then
  37. xdg-open "$WINECONFIG"
  38. exit 0
  39. fi
  40. . "$WINECONFIG"
  41. # prefer wine-staging, it works best ATM
  42. if [ -z "${WINEPATH:-}" ]; then
  43. if [ -e /opt/wine-staging/bin/wine ]; then
  44. export PATH=/opt/wine-staging/bin:$PATH
  45. else
  46. echo "For improved frame rate wine-stating 6.7+ is recommended."
  47. if [ -e /opt/wine-devel/bin/wine ]; then
  48. export PATH=/opt/wine-devel/bin:$PATH
  49. else
  50. echo "Using default wine installation..."
  51. fi
  52. fi
  53. fi
  54. case $action in
  55. start)
  56. exec ${WINESTARTCMD:-wine cmd /c launcher.bat}
  57. ;;
  58. stop)
  59. # no better way to do this?
  60. ${WINESTOPCMD:-killall *.exe}
  61. ;;
  62. killwineserver)
  63. ${KILLWINESERVER:-wineserver -k}
  64. ;;
  65. *)
  66. helpexit
  67. ;;
  68. esac