Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xbmc
- import subprocess,os
- class Screensaver(xbmc.Monitor) :
- print("[CUSTOM SCRIPT]Checking PlayBackState")
- def __init__ (self):
- xbmc.Monitor.__init__(self)
- def onScreensaverDeactivated(self):
- print("[CUSTOM SCRIPT]XBMC in use")
- os.system("sudo python /home/xbian/.xbmc/addons/service.procmanager/resources/stopall.py") #Calls another script to stop process
- def onScreensaverActivated(self):
- print("[CUSTOM SCRIPT]XBMC in Standby")
- os.system("sudo python /home/xbian/.xbmc/addons/service.procmanager/resources/startall.py") #Calls another script to start process
- def onAbortRequested(self):
- print("[CUSTOM SCRIPT]XBMC is closing")
- os.system("sudo python /home/xbian/.xbmc/addons/service.procmanager/resources/startall.py") #Makes sure processes are running if xbmc gets closed
- print("[CUSTOM SCRIPT]**Working**")
- monitor=Screensaver()
- while not xbmc.Monitor().onAbortRequested(): #End if XBMC closes
- xbmc.sleep(5000) #Repeat (ms)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement