[mythtv-users] Looking for opinions on implementing screensaver
capability
Joseph A. Caputo
jcaputo1 at comcast.net
Mon Dec 22 16:03:07 EST 2003
On Monday 22 December 2003 15:25, Alan Snyder wrote:
> I'm looking at ways to implement screen blanking
> capability within myth, basically so that a screen
> left at a menu will blank to save the CRT or the LCD
> lamp. Right now I'm doing it while running Knoppmyth
> from CD with a shell script that periodically checks
> on how much CPU mythfrontend is using (could easily be
> extended to add mplayer) and calls xset appropriately,
> but that's really a kludge.
>
> I see some options for doing this and seek opinions on
> which might be preferable:
>
> 1. Add xset calls directly in the code. This would
> allow things like blanking a screen left too long on
> pause and so forth. But it would require a patch to
> every plugin to handle the screensave option.
>
> 2. Add capabilities to myththemedmenu to allow screen
> blanking options in menu items. This may seem like an
> odd approach, but it would allow screensave on/off to
> behandled in the xml menus and therefore no patching
> of any plugins. On the other hand, screen saver of
> blanking would be on a per-plugin basis and
> within-plugin stuff like handling a paused video would
> not be included.
>
> Any opinions? If I can get our kitchen setup
> transitioned from Knoppmyth to HD I want to find time
> to work on this over "winter break."
If you want my $.02, I think that direct Xt or Xlib calls should be made
instead of calling an external executable like xset. Take a look at
how Ogle does it. Basically, if the screensaver is allowed (global
setting), then it will be enabled when mythfrontend starts up. Certain
modules that wish to disable the screensaver (like NuppelVideoPlayer,
or mythmusic visualizations) would call a Myth function like
'disable_screensaver' (a wrapper around Xlib/Xt calls) upon entry and
call 'restore_screensaver_setting' (basically the same code that would
be run on mythfrontend startup) on exit. You could also make some
hooks into the menu class so that with a little XML in your menu you
could disable the screensaver upon execution of an external command
(like mplayer).
Like I said, just my $.02, but since I'm not the one volunteering to
code it, you're free to implement it however you like.
-JAC
More information about the mythtv-users
mailing list