[mythtv-users] mythwelcome questions

Ma Begaj derliebegott at gmail.com
Sat Oct 13 09:16:26 UTC 2007


One additional change, because I found one problem with my perl
script: it also shutdown my mythbox even when I was logged in over
ssh. If you use SSH connections, you can add these lines in the
beginning of the WHILE loop of the perl script:

-------------------------------------------------------------------
   ## disable screensaver if root looged in
   if (`ls -l /dev/pts | wc -l` ge 2) {
      system("xscreensaver-command -deactivate");
      next;
   }
-------------------------------------------------------------------


this will deactivate screensaver and wait again for the next
activation of the screensaver.

M.
2007/10/12, Ma Begaj <derliebegott at gmail.com>:
> > Care to post your scripts and solutions in more detail?  This looks
> > useful!
>
> here is the code:
>
> .xinitrc starts xscreensaver without splash screen, perl script which
> watches for screensaver status and mythwelcome with a new log file
> every time:
> --------------------------------------------------------------------
> fvwm2 &
> ps -C xscreensaver || xscreensaver -no-splash &
> killall -9 screensaver-watch >/dev/null 2>&1
> /home/mythtv/screensaver-watch >/dev/null 2>&1 &
> /usr/bin/mythwelcome >/tmp/mythfront`date +%FT%T` 2>&1
> --------------------------------------------------------------------
>
> screensaver-watch is a perl script which catches xscreensaver status:
> --------------------------------------------------------------------
> #!/usr/bin/perl -w
> use strict;
>
> delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
> $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin';
>
> $<=0;
>
> open(XS,"/usr/bin/xscreensaver-command -watch|") or die;
> while(<XS>) {
>
>    ## close mythfrontend and deactivate screensaver
>    if(/^BLANK/i) {
>       system("killall mythfrontend");
>       system("xscreensaver-command -deactivate");
>    }
> }
> --------------------------------------------------------------------
>
> when the xscreensaver status is BLANK, the perl script kills the
> mythfrontend, deactivates screensaver and mythwelcome is automatically
> active. I set in mythwelcome to shutdown mythbox in 60 seconds after
> getting active.
>
> other recognized xscreensaver status are: UNBLANK and LOCK, so you can
> expand the script.
>
> the shutdown time for mythwelcome can be set in mythwelcome
> preferences (mythwelcome -s).
> idle timeout for xscreensaver (how long to wait to get activated) can
> be set in ~/.xscreensaver or in a gui (run xscreensaver-demo).
>
>
> M.
>


-- 
Glauben heißt nicht wissen wollen, was wahr ist ... Nietzsche


More information about the mythtv-users mailing list