[mythtv-users] Two actions off one lirc keypress?

Robin Gilks g8ecj at gilks.org
Thu Aug 3 02:47:47 UTC 2006


Greetings

Having at last got a string of IR leds on my IR blaster I can now turn my
TV & theatre amp on/off under control of the mythboxen. I use an irexec
entry in the lircrc file to run a shell script that does the necessary ir
blaster commands to do this.

What I'd ALSO like to have it fire a command up to mythtv when I power the
TV & amp off to jump to the top level menu. Can I chain commands under
irexec so that a keypress (mapped to the main menu jump-point) is sent up
to mythtv?

I THINK I may need an equivalent of irxevent but which I can call inline
from the shell script to pass a key up to mythtv. Sort of a keyboard
stuffer where I can specify the key and the application that gets it...


This is my 'power_toggle.sh' shell script:
#!/bin/sh

TV=panasonic_tv_01
AMP=amplifier

if [ -e ~/.power ]
then
#power down
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $TV power
sleep 1
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $AMP power
rm -f ~/.power
#<<<<<< send keypress to mythtv to jump to main_menu ????

else
#power up
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $TV one
sleep 1
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $AMP tuner
sleep 4
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $TV av
touch ~/.power
fi



and the tail end of my lircrc file

begin
    prog   = irexec
    button = Power
    config = /usr/local/bin/power_toggle.sh
end


-- 
Robin Gilks




More information about the mythtv-users mailing list