[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)
#41
(2013-06-26, 20:40)sIRwa2 Wrote: thanks for your answer,

Interesting idea, I could but in a timer in my py script,so it runs irtoy after, say, 10 minuts. but then i need the posibility to cancel the timer on screensaver off...

can this be done? like firing a second script to cancel the first? im not a programmer.

Maybe the easiest thing would be to create two scripts.

The first script responds to the screensaver off and just creates a file in a temporal folder:

* Script when screensaver is off
Code:
#/bin/sh
touch /tmp/screensaver_off

The second one responds to screensaver on and removes the previous file, waits for 10min and then rechecks the existence of the file before performing anything...

* Script when screensaver is on
Code:
#/bin/sh
rm /tmp/screensaver_off
sleep 10m
if [ -e /tmp/screensaver_off ]; then
# Do whatever you need here
fi


PS: I am just writing that scripts by heart so they might not have the correct syntax! Also I am assuming linux/mac so /bin/sh works and there is a /tmp folder but you can do a similar thing in any scripting language (python, etc.) and in any folder you want.


(2013-06-27, 03:40)matbor Wrote: Thanks for the script, have got my 4x XBMC's publishing there status using MQTT to a MQTT Broker, screenshot here... more to come....

Nice! sounds like a cool project!! Nod
Reply


Messages In This Thread
Great! - by gnorf - 2013-02-27, 22:50
RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - by pilluli - 2013-06-27, 10:25
[RELEASE] Pilulli Revisited - by KenV99 - 2014-06-28, 18:18
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)4