KMPlayer screensaver disabler

Utilities

Source:

0
Score 59%
Description:

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.
Last changelog:

12 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

12 years ago

Things can be much easier done:
----
#!/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

C

randomlinuxuser

12 years ago

Well... this is another case of the classic "itch-scratching". I have a LCD monitor, so I don't use screensavers, but rather set it to auto power-off after 1 minute, and I can't find any dcop call that can disable that. I use auto power-off because screensavers are bad for LCDs as they don't actually "save" anything (the screen is still on and functioning as normal).

Plus, I heard MPlayer has the exact same idea for disabling the screensaver & co. during playback.

Report

C

randomlinuxuser

12 years ago

Also, I can't seem to find *any* screensaver disabler in the KMPlayer config... where did you find the half-working one (I'm using Xine as backend btw, if that matters)? O.o

Report

ricce

12 years ago

At least my kmplayer disables the screesaver when I put it in fullscreen -- but it forgets to re-enable it again (quite annoying).

Report

C

randomlinuxuser

12 years ago

Well, you can just write a wrapper script that fixes the problem :)

Actually I wrote one for that just now, and posted it in the description section of the page 'cause it's so short.

Report

12 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.

product-maker 9 16

File (click to download) Version Description Packagetype Architecture Downloads Date Filesize DL OCS-Install
Pling me
Details
license
version
1.4
updated Apr 26 2006
added Apr 23 2006
downloads today
0
page views today 0
System Tags app software