Looking for addon for games/apps
#1
Right now I have XBMC configured to auto-suspend if idle for more than 10 minutes, and I was wondering if there's any addon that can either override the powersaving options or close XBMC run some game/app and open XBMC again when finished. Most like teeedubb's Steam Launcher, but without using steam at all.

I've checked Advanced Launcher and RCM but there's no option to close XBMC, so when I play a game using any of these launchers, the PC powers off (suspends) when playing for more than 10 minutes.

The ideal thing should be to close XBMC, run the game and relaunch XBMC when the game is finished (you exit the game). Is there any addon that could do this? Or maybe its there any specific setup with any of the given addons that should I apply to achieve this?

Thanks in advance.
Reply
#2
You could create an external script or cmd, with your script engine of choice, that close xbmc, launch you program and on closing it, relaunch xbmc. You could then use advance launcher to call this script instead of your application.
Reply
#3
Thanks Tuxon86, I didn't thought about it. I'm gonna try to code a little Python program to handle all the stuff.
Reply
#4
To complete Tuxon86 reply, you MUST pass by an external script. If you start a game and close XBMC (and the included plugins) how XBMC (or the included plugins) will now that the game is closed or not? All this control must be done externally of XBMC. So you need to pass by an external and independent script. And that for this reason that you do not have any option for that into Advanced Launcher.
Reply
#5
Does anyone know a working way to do it? I've coded some lines in python but I have two problems:
1) XBMC doesn't like to call the python3 interpreter from Advanced Launcher, it gives me an error about not finding something.
2) The game doesn't like being called from the python script and it gives me another error.

This is the code I'm using:
Code:
import argparse
import os
import subprocess
import re
import time
import sys

# XBMC path to the executable file
xbmc_path=r"C:\Program Files\XBMC\xbmc.exe"

# Check args
parser = argparse.ArgumentParser()
parser.add_argument('exec', nargs='+')
args = parser.parse_args()
if args.exec == None:
    sys.exit()
program = ' '.join(args.exec)
# Check game path
if not os.path.isfile(program):
    sys.exit()

# Kill XBMC
os.system("TASKKILL /IM xbmc.exe")
time.sleep(10)

# Launch game
process = subprocess.Popen(program)
process.wait()

# Relaunch XBMC
subprocess.Popen(xbmc_path)

From Advanced Launcher I'm calling C:\Python34\python.exe with the following parameters: C:\above_script.py C:\Path\to\game\game.exe

I don't know how to do it from CMD, but if anyone could point me, I could try to see if it works.
Reply

Logout Mark Read Team Forum Stats Members Help
Looking for addon for games/apps0