
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
Basically, this is a wrapper script that prevents screensavers and monitor auto power-offs from working when KMPlayer is running.
It uses a simple program I wrote which periodically fakes user key presses (the default is the num-lock key pressed twice).
Of course, you can also modify the wrapper script so that another program is used instead of KMPlayer.
The attached file includes both the source and binary.
Hope this will prove useful to *someone* :) Though please note that this is, after all, a crude hack, and it'd be really nice if KMPlayer will have a built-in screensaver disabler in the near future.
--------------------------
Also, KMPlayer has a bug with regards to screensavers in that it will disable KScreensaver when in full screen mode, but forget to enable it again. I've written the following (very) short script to workaround the problem (just copy and paste into a file and set the execution permissions):
#!/bin/sh
screensaverstate=`dcop kdesktop KScreensaverIface isEnabled`
kmplayer $@
dcop kdesktop KScreensaverIface enable $screensaverstate
The idea is of course that if you're going to use the built in screensaver disabler in KMPlayer (which works *only* with KScreensaver), you won't need the fake-key-press program.
14 years ago
1.3 -> 1.4 - Added a SIGINT handler (uses the same exit routine as the SIGTERM handler) for keyboard aborts (Ctrl-C). Minor cleanup of the code.
1.2 -> 1.3 - Added a real SIGTERM handler which properly closes the X window connection instead of relying on the default SIGTERM procedure.
1.1 -> 1.2 - Fixed a really stupid bug in the wrapper script, where the script only passes the arguments including and after the second one onto kmplayer, while the first argument is discarded.
14 years ago
1.3 -> 1.4 - Added a SIGINT handler (uses the same exit routine as the SIGTERM handler) for keyboard aborts (Ctrl-C). Minor cleanup of the code.
1.2 -> 1.3 - Added a real SIGTERM handler which properly closes the X window connection instead of relying on the default SIGTERM procedure.
1.1 -> 1.2 - Fixed a really stupid bug in the wrapper script, where the script only passes the arguments including and after the second one onto kmplayer, while the first argument is discarded.
ricce
14 years ago
----
#!/bin/bash
dcop kdesktop KScreensaverIface enable false
kmplayer $*
dcop kdesktop KScreensaverIface enable true
----
OK, this will only work if you are using kscreensaver, but you are right...
Anyway, I think kmplayer have a half working screensaver desabler.
Report
randomlinuxuser
14 years ago
Report
ricce
14 years ago
Report
randomlinuxuser
14 years ago
Actually I wrote one for that just now, and posted it in the description section of the page 'cause it's so short.
Report
randomlinuxuser
14 years ago
Plus, I heard MPlayer has the exact same idea for disabling the screensaver & co. during playback.
Report