NMT:wait4remote: Difference between revisions

From Lundman Wiki
mNo edit summary
No edit summary
Line 1: Line 1:
== wait4remote ==
== wait4remote ==


''wait4remote'' is tiny utility that you can use from bourne shell scripts to wait for a button push on the remote controller.
'''wait4remote''' is tiny utility that you can use from bourne shell scripts to wait for a button push on the remote controller.


  # ./wait4remote  
  # ./wait4remote  
Line 18: Line 18:
  Jorgen Lundman <lundman@lundman.net>
  Jorgen Lundman <lundman@lundman.net>


If you use "1,EJECT 2,INFO" as the argument, ''wait4remote'' will return code "1" when EJECT button is pushed, or "2" when INFO button is pushed.
If you use "1,EJECT 2,INFO" as the argument, '''wait4remote''' will return code "1" when EJECT button is pushed, or "2" when INFO button is pushed.


If bourne shell you can use:
If bourne shell you can use:

Revision as of 06:57, 11 April 2009

wait4remote

wait4remote is tiny utility that you can use from bourne shell scripts to wait for a button push on the remote controller.

# ./wait4remote 

- wait for keys or buttons to be pushed on remote control
[-v] [-t sec] x,str [ y,str ... ]

 options:
        -v       : verbose, print key codes
        -t sec   : timeout waiting for button after 'sec' seconds
       x,str     : 1,eject 2,info. Return 1 when Eject button pushed
If this program does not know the remote control key code, you can
use 1,239 for EJECT.


Jorgen Lundman <lundman@lundman.net>

If you use "1,EJECT 2,INFO" as the argument, wait4remote will return code "1" when EJECT button is pushed, or "2" when INFO button is pushed.

If bourne shell you can use:

wait4remote 1,EJECT 2,INFO
if [ $? = 2 ]; then
  echo "INFO button was pushed"
fi


Source

Binary