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

Robin Gilks g8ecj at gilks.org
Thu Aug 3 08:53:48 UTC 2006


>>
>> 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?
>>
>
> "Enable Network Remote Control interface" in
> Setup - General, then create another script.
>
> eg. /usr/local/bin/mainmenu
>
>   #!/usr/bin/expect -f
>   spawn $env(SHELL)
>   send -- "telnet localhost 6546\r"
>   expect "#"
>   send -- "jump mainmenu\r"
>   expect "#"
>   send -- "exit\r"
>   expect eof
>
>> 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 ????
>
> /usr/local/bin/mainmenu
>
>>
>> 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
>
>

Hi Rod

I forgot about the network control interface. netcat is my friend!! A
single line of
    echo -e "jump mainmenu\r" | nc -w 1 localhost 6546
did the trick :-)

Cheers

-- 
Robin Gilks




More information about the mythtv-users mailing list