Skip to content

Instantly share code, notes, and snippets.

@xDShot
Created August 7, 2023 18:54
Show Gist options
  • Save xDShot/a25a4b5c61700d6e172defdfb799e915 to your computer and use it in GitHub Desktop.
Save xDShot/a25a4b5c61700d6e172defdfb799e915 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os
import sys
from ctypes import CDLL
from subprocess import run
os.environ["STEAM_COMPAT_CLIENT_INSTALL_PATH"] = os.getenv("HOME") + "/.local/share/Steam/"
os.environ["PROTONDIR"] = os.getenv("STEAM_COMPAT_CLIENT_INSTALL_PATH") + "steamapps/common/Proton - Experimental/"
#os.environ["WINEDEBUG"] = "-all"
#os.environ["PROTON_LOG"] = "1"
os.environ["STEAM_COMPAT_DATA_PATH"] = "/seagate/wineprefixes/pop/"
os.environ["STEAM_COMPAT_SHADER_PATH"] = os.getenv("STEAM_COMPAT_DATA_PATH") + "/shadercache/"
os.environ["WINEPREFIX"] = os.getenv("STEAM_COMPAT_DATA_PATH") + "/pfx/"
os.environ["STEAM_COMPAT_INSTALL_PATH"] = os.getenv("WINEPREFIX") + "/drive_c/popww/"
#os.environ["PROTON_USE_WINED3D"] = "1"
inject_steamapi = False
# POP WW
#os.environ["SteamAppId"] = "221410" #"13500"
if inject_steamapi:
# Enable Steam Overlay
os.environ["LD_PRELOAD"] = os.getenv("STEAM_COMPAT_CLIENT_INSTALL_PATH") + "/ubuntu12_64/gameoverlayrenderer.so"
# You can get libsteam_api.so from one of your Steam games
try:
#steam_api = CDLL(os.getenv("PROTONDIR") + "/files/lib64/libsteam_api.so")
steam_api = CDLL("/seagate/steamworks_sdk_151/sdk/redistributable_bin/linux64/libsteam_api.so")
steam_api.SteamAPI_Init()
except:
print("Failed to initialize Steam API")
sys.exit(1)
proton_cmd = [ os.getenv("PROTONDIR") + "proton", "waitforexitandrun" ]
wine_cmd = [ "wine" ]
run_commands = proton_cmd + [ os.getenv("STEAM_COMPAT_INSTALL_PATH") + "PrinceOfPersia.exe" ]
#run_commands = "taskset -c 1".split() + run_commands
#run_commands = [ "zink-wrap" ] + run_commands
run_commands = "gamescope -f -U -w 1280 -h 960 -r 58 --".split() + run_commands
#run_commands = [ os.getenv("PROTONDIR") + "proton", "waitforexitandrun", sys.argv[1::] ]
run( run_commands, cwd = os.getenv("STEAM_COMPAT_INSTALL_PATH") )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment