Skip to content

Instantly share code, notes, and snippets.

@steevp
Last active January 17, 2024 10:42
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save steevp/4f531fd7ae5fd62e7f06 to your computer and use it in GitHub Desktop.
Save steevp/4f531fd7ae5fd62e7f06 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