Skip to content

Instantly share code, notes, and snippets.

@KennethBenicio
Forked from steevp/openmw_steam.py
Created August 20, 2021 13:19
Show Gist options
  • Save KennethBenicio/cea4f6a1d1f6b76779c8d916338948e2 to your computer and use it in GitHub Desktop.
Save KennethBenicio/cea4f6a1d1f6b76779c8d916338948e2 to your computer and use it in GitHub Desktop.
Launch openmw and have Steam track your gameplay hours, etc as if you were playing Morrowind
#!/usr/bin/env python
import os
import sys
from ctypes import CDLL
from subprocess import call
# Morrowind
os.environ["SteamAppId"] = "22320"
# Enable Steam Overlay
os.environ["LD_PRELOAD"] = os.getenv("HOME") + "/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so"
# You can get libsteam_api.so from one of your Steam games
try:
steam_api = CDLL("./libsteam_api.so")
steam_api.SteamAPI_Init()
except:
print("Failed to initialize Steam API")
sys.exit(1)
call(["openmw"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment