[mythtv-users] harmony remote and start/stop scripts

Aaron aaron at rb303.net
Fri May 11 00:52:30 UTC 2012


I am trying to get my Harmony remote to start/stop the mythfrontend to make
it simpler for my family to do different things. I am on Mythbuntu 12.04
32bit. I have setup a irexec file, and made sure its running in daemon
mode. It all seems to kinda work, but not really sure what I'm missing to
make it run 100%. Here are my files, I think I just need another pair of
eyes to help me see what I am missing.

The parts I can't easily show are I have my Harmony remote set to run two
different activities. First one is "Watch TV" , second is "Watch Movies".
The watch TV activity is set to use the TV for audio (HDMI); then the
movies activity is set to use SPDIF to my receiver. I have it set to send
KEY_BLUE and KEY_YELLOW as the power on/off sequence from the remote. I
have verified it is sending them with irw.

The reason behind all this is my wife seems to get easily confused, so I am
trying to eliminate all "hassles" with switching applications. I should
mention when I run these scripts by hand they run flawlessly. So I'm not
really sure where or why its not running correctly. The results are
baffling. If I press "Watch TV" MythTV will pop up then close, then XBMC
will open. If I press "Watch Movies" it does the opposite. At first I
thought I had the Blue and Yellow wrong in the remote, but I've verified it
many times. I have also switched KEY_BLUE and KEY_YELLOW in the irexec
file, but it didn't seem to make a difference. Any incite would be much
appreciated.

~/.lirc/irexec
# MythTV
begin
     remote = mceusb
     prog = irexec
     button = KEY_BLUE
     config = ~/scripts/mythtv_start.sh &
end

# XBMC
begin
     remote = mceusb
     prog = irexec
     button = KEY_YELLOW
     config = ~/scripts/xbmc_start.sh &
end

~/scripts/mythtv_start.sh
#!/bin/bash
# Test to see if XMBC is running first
if ps -ef | grep xbmc.bin | grep -v grep
then
killall -v -s9 xbmc.bin
fi
# Now to see if MythTV is running
if ps -ef | grep mythfrontend | grep -v grep
then
# Do nothing
echo “MythTV already Running!”
else
# Startup MythTV
mythfrontend
fi
exit

~/scripts/xbmc_start.sh
#!/bin/bash
# Test to see if MythTV is running
if ps -ef | grep mythfrontend | grep -v grep
then
        killall -v -s9 mythfrontend.re
fi
# Now to see if XBMC is running
if ps -ef | grep -v grep | grep -i xbmc.bin
then
# Do nothing
echo “XBMC already Running!”
else
# Startup XBMC
xbmc
fi
exit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20120510/984bc3c1/attachment.html>


More information about the mythtv-users mailing list