Skip to content

Commit 439242a

Browse files
committed
added ability for user to specify arguments to pass to steam
1 parent 28c6912 commit 439242a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

resources/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import requests
44
import routing
5+
import shlex
56
import subprocess
67
import sys
78
import time
@@ -142,10 +143,12 @@ def run(id):
142143

143144
return
144145

145-
log('executing ' + __addon__.getSetting('steam-path') + ' steam://rungameid/' + id)
146+
userArgs = shlex.split(__addon__.getSetting('steam-args'))
147+
148+
log('executing ' + __addon__.getSetting('steam-path') + ' ' + __addon__.getSetting('steam-args') + ' steam://rungameid/' + id)
146149

147150
# https://developer.valvesoftware.com/wiki/Steam_browser_protocol
148-
subprocess.call([__addon__.getSetting('steam-path'), 'steam://rungameid/' + id])
151+
subprocess.call([__addon__.getSetting('steam-path')] + userArgs + ['steam://rungameid/' + id])
149152

150153
def main():
151154

resources/settings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
<setting id="steam-id" type="text" label="Your Steam user id"/>
55
<setting id="steam-key" type="text" label="Your Steam web API key"/>
66
<setting id="steam-path" type="executable" label="Path to your Steam executable"/>
7+
<setting id="steam-args" type="text" label="Arguments to pass to your Steam executable"/>
78
</settings>

0 commit comments

Comments
 (0)