View Full Version : Run a Program (or Script) on Screensaver Start/Stop?
Hi All,
I am hoping that XBMC has this feature, but I am doubtful that it does, I would like to be able to run a script when the screen saver starts/stops.
My rear pro TV has a fully documented RS232 (Com port) interface that allows a computer to turn it on/off and various other things, it is simple enough to use and I can already control it from the PC.
My family likes to forget to turn the tv off once they have finished watching, and to save the lamp I would like to switch it off if the screen saver starts. I am just hoping that there is already a feature in place to execute a program/script when the screen saver starts.
If not, I am already downloading the sources to hack it into XBMC :).
Any comments?
Sorry, no such feature currently, please feel free to make a feature request on trac. Think more people might find this useful. I for one can see usage with it, update database, turn of fileservers (if nothing is playing), etc.
Well, since I want it now, and not wait for someone else to implement it, I will hack it in and post a patch, I have already added the new settings, just have to add the code to run them when the screensaver starts/ends, which is simple enough :). I should have a patch in a few days :)
Gamester17
2009-01-05, 14:51
http://xbmc.org/trac
http://xbmc.org/wiki/?title=HOW-TO_submit_a_patch
http://xbmc.org/wiki/?title=Appendix_D:_Development_Notes
http://xbmc.org/wiki/?title=HOW-TO_submit_an_official_feature_request
sounds good :) that is the great thing about opensource, you can add it yourself :)
Patch here: http://xbmc.org/trac/ticket/5601
I am waiting for it to finish compiling though, so it is untested at the moment, but if someone would like to review it to make sure that I have not done something really dumb, please do so.
Still waiting for the compile to finish, had problems with Goom and the screen savers from SVN, they have compile issues, just hacked them around to make it compile, so waiting still.
It has however compiled without errors, just cant test that it works
Well, the patch works properly, two new settings appear in the screensaver settings, one for on start, and one for on exit. My HTPC now will turn off my TV when it has been sitting idle for 20 mins.
Nuka1195
2009-01-07, 00:28
i think a browse control would be better for this to set the script.
Gamester17
2009-01-07, 01:19
Would be cool to use with a folding@home client
http://folding.stanford.edu/
or SETI@home if you are in to that instead:
http://setiathome.berkeley.edu/
Personally I would like which app to use configurable from the GUI :cool:
Someone else would have to add windows/mac support as I run neither systems....
However, for windows the "ShellExecute" API should be the one to look at.
Since mac is POSIX/UNIX it should already work, unless I am mistaken.
For the browser, what is the file browser control called? I would have preferred this too.
Nice job, but I am afraid Nuka is right a browsecontroll would be ideal :)
May I ask why you felt that it should be attached to screensaver ?
Would be better if it was on gui like so
Idle Timeout
OnIdle -> blank | Screensaver | Sleep | < python script >
OnLostIdle -> blank | <python script >
Their should be icon next to browse for the script ..
Some of things they can do within the script:
1) Update Library
2) Dispaly Screensaver
3) Run program ..
BUTTON_CONTROL_PATH_INPUT is that type of control I think they are referrring too ..
May I ask why you felt that it should be attached to screensaver ?
No particular reason
My lack of experiance with XBMC is limiting my ability to implement this feature. People want this to be more then just a simple "execute" function, they want to be able to start a program, and have XBMC stop it automatically when it is no longer idle.
The simple idea is to just lanuch a program/script on idle, and one on resume, then the user can write a script to do whatever the hell they want it to do.