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

Rod Emerson rod at emerson.id.au
Thu Aug 3 05:53:19 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




More information about the mythtv-users mailing list