[mythtv-users] /usr/local/bin/mythpowerbutton.sh

White Joe joe.white at consultant.volvo.com
Sun Mar 19 02:50:26 UTC 2006


 

> -----Original Message-----
> From: mythtv-users-bounces at mythtv.org 
> [mailto:mythtv-users-bounces at mythtv.org] On Behalf Of Nick
> Sent: Saturday, March 18, 2006 8:06 PM
> To: Discussion about mythtv
> Subject: Re: [mythtv-users] /usr/local/bin/mythpowerbutton.sh
> 
> On 18/03/06, White Joe <joe.white at consultant.volvo.com> wrote:
> > I have been running MythTV for a little over a year now, 
> and its time to
> > get
> > that Power Button script from Jarod's guide working.   All 
> of the other
> > buttons work, and its feeling lonely.
> >
> > 1) I have the file ~/.mythtv/lircrc, which contains only 
> one reference
> > to
> > POWER in the entire file.
> > # Power Button
> > begin
> > prog = irexec
> > button = POWER
> > repeat = 4
> > config = /usr/local/bin/mythpowerbutton.sh
> > end
> 
> Looks fine
> 
> > 2) I run irw and push the power button and get:
> >
> > 000000000000114c 00 POWER rs15-2116-vcr0081
> 
> Button is recognised
> 
> > 3)  /usr/local/bin/mythpowerbutton.sh was created under the 
> root user
> > and
> > given the appropriate permissions -- chmod +x
> > /usr/local/bin/mythpowerbutton.sh
> >
> > #!/bin/bash
> > PROG=mythfrontend
> > STATUS=`ps -e | grep $PROG | grep -v grep | wc -l | awk 
> '{print $1}'`
> > if [ `echo $DISPLAY | grep -c ":0"` -ge 1 ]
> > then
> >     if [ $STATUS -eq 0 ]
> >     then
> >         ( $PROG & )
> >     else
> >         killall $PROG
> >     fi
> > fi
> > exit 0
> 
> Same as mine
> 
> > 4) myth-load.sh
> 
> snipped non-LIRC commands
> 
> >     # Launch irexec for myth power button stop/start
> >     irexec &
> 
> I use the command:
> 
> /usr/local/bin/irexec -d /home/mythtv/.lircrc
> 
> which provides the name of the LIRC config to use and daemonises
> irexec (ideal for running irexec from a startup script). Check to make
> sure your ~/.lircrc (which is the default file used if you don't
> specify one) contains the POWER config (or is symlinked to the MythTV
> file).
> 
> Nick
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>

Perfecto!  That did it.  Thank you very much.

jw 


More information about the mythtv-users mailing list