aird
— USB Apple
IR receiver daemon
aird |
[-vd ] [-p
pidfile] [-k
key] -f
device [-M
menu command] [-P
play command] [-F
forward command] [-B
backward command] [-U
volume up command] [-D
volume down command] |
The aird
daemon handles Apple IR receiver
button events. If your system has an USB Apple IR receiver, most likely
you'll also have an Apple Remote. An Apple remote has six (6) buttons:
Volume up, Volume down, Play/Pause, Forward, Backward and Menu. For each
button you can assign a command to execute.
Apple IR receiver modules are found on:
- MacBook (any generation)
- MacBook Pro (any generation)
- Intel iMac
- Intel MacMini
The following program options are available:
-v
- Enable verbose mode.
-d
- Toggles the daemon flag.
-p
pidfile
- Use the specified file to store the process ID.
-f
device
- Read from the specified device entry. This is mandatory.
-k
key
- Only accept commands from the remote with the specified
key. See the
EXAMPLES section to understand how
remote pairing works.
The following options specify commands to run upon button down
events:
-M
menu command
- Command to run when the daemon recieves a notification that the
button was pressed.
-P
play command
- Command to run when the daemon recieves a notification that the
Play/Pause
button was pressed.
-F
forward command
- Command to run when the daemon recieves a notification that the
Forward
button was pressed.
-B
backward command
- Command to run when the daemon recieves a notification that the
Backward
button was pressed.
-U
volume up command
- Command to run when the daemon recieves a notification that the
Volume Up button was pressed.
-D
volume down command
- Command to run when the daemon recieves a notification that the
Volume Down button was pressed.
Note that lower case options are program options and upper case
options specify the commands to run upon button down events.
- /var/run/aird.pid
- The default location of the PID file.
To pair a remote controller with your IR receiver, do the
following:
Then press the Menu and
Forward keys at the same time for five seconds. The
following will show up:
Your Apple remote pairing key is: 131
Next time you run aird, pass this number as the -k argument.
This example shows how to control
mpd(1)
with
aird(1).
You need
mpc(1) and
ncmpc(1)
installed. Run
aird(1)
from your ~/.xinitrc startup file like this:
aird -p ~/.aird.pid -f /dev/uhid1 -P "mpc toggle" -F "mpc next" \
-B "mpc prev" -U "mixer vol +2" -D "mixer vol -2" \
-M "xterm -e ncmpc"
If you want to stop other users from gaining control of the IR
receiver and to prevent commands to be executed when someone presses a
button on the remote control, run
aird(1)
only with the -f
argument:
The aird
utility first appeared in
FreeBSD 8.0.
Rui Paulo
⟨rpaulo@FreeBSD.org⟩