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

White Joe joe.white at consultant.volvo.com
Sat Mar 18 06:47:35 UTC 2006


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

2) I run irw and push the power button and get:

000000000000114c 00 POWER rs15-2116-vcr0081

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


4) myth-load.sh

#!/bin/bash

# Only do this stuff if we're on the main display
# (i.e., don't do this in a vnc session)
if [ `echo $DISPLAY | grep -c ":0"` -ge 1 ]
then
    # Load nVidia driver custom settings
    nvidia-settings --load-config-only &
    # Restore audio settings
    /usr/sbin/alsactl restore
    # Launch irexec for myth power button stop/start
    irexec &
    # Launch myth frontend
    mythfrontend &
    # Disable dynamic power management (screen blanking)
    /usr/X11R6/bin/xset -dpms
    # Disable screen saver
    /usr/X11R6/bin/xset s off
fi
exit

5)  25868 pts/3    00:00:00 irexec  


is there more?  what am I missing?


jw



More information about the mythtv-users mailing list