2012-06-23, 22:40
I've got an Python script and would like to detect when de XBMC Screensaver is active
I am running XBMCbuntu "Eden 11.0"
Does anyone have a simple python routine to check the screensaver state ?
I found this list of Boolean conditions: Boolean Conditions
I tried this code:
while (not xbmc.abortRequested) :
if xbmc.System().ScreenSaverActive() :
...< do something > ....
But resulted in an error:
ERROR: Traceback (most recent call last):
File "/home/xbmc/screensaverstate.py", line 14, in <module>
print xbmc.System().ScreenSaverActive()
AttributeError: 'module' object has no attribute 'System'
Found a workaroud:
Get TimeOut setting
screensavertime = xbmc.executehttpapi( "GetGUISetting(0;screensaver.time)" ).replace( "<li>", "" )
Get Idle Time
it = xbmc.getGlobalIdleTime()
I am running XBMCbuntu "Eden 11.0"
Does anyone have a simple python routine to check the screensaver state ?
I found this list of Boolean conditions: Boolean Conditions
I tried this code:
while (not xbmc.abortRequested) :
if xbmc.System().ScreenSaverActive() :
...< do something > ....
But resulted in an error:
ERROR: Traceback (most recent call last):
File "/home/xbmc/screensaverstate.py", line 14, in <module>
print xbmc.System().ScreenSaverActive()
AttributeError: 'module' object has no attribute 'System'
Found a workaroud:
Get TimeOut setting
screensavertime = xbmc.executehttpapi( "GetGUISetting(0;screensaver.time)" ).replace( "<li>", "" )
Get Idle Time
it = xbmc.getGlobalIdleTime()