First of all, a note of warning of what to expect and what not to expect. Even though you'll get your Apple Remote Control working under Linux, this won't be Front Row. In Front Row, the remote functions differently depending on the context -- e.g. in DVD menus pressing forward/back will navigate the options, while "play/pause" will work as "select." With LIRC, you can only configure each button to have one function, so your Apple Remote will be nothing more than a 6-button remote control.
With that in mind, it's still quite nice to be able to pause the movie or adjust volume without getting off the couch, so here's how to do it.
Get the stuff
First, get all the necessary bits:
# yum install lirc pulseaudio-module-lirc totem-lircSetting up LIRC
LIRC works like this -- a daemon listens to the HID device (builtin IR receiver) and maps events to its list of recognized buttons. There is a couple of contributed configurations, but they wouldn't work for me, so we'll generate our own. Run:
irrecord -H macmini -d /dev/hiddev0 /etc/lircd.confRead carefully the instructions, it's important! I labeled the buttons as follows:
menu, volume_up, volume_down, backward, forward, play_pauseOnce you are done, you should have everything you need to make the remote work. Now, edit /etc/sysconfig/lirc and set:
LIRCD_OPTIONS="-H macmini -d /dev/hiddev0"Now start lircd up:
chkconfig lirc onYou can test it to make sure that it's working by running:
service lirc start
irw /dev/lircdPress a few buttons and you should see events show up on the console. If something is not working, troubleshoot the previous steps. For your reference, my lircd configuration is available here: my /etc/lircd.conf.
Now you have to set up the "client" side of lirc, by setting up an /etc/lircrc. The format is really quite verbose -- I'd hate to do this for remotes that have more than 6 buttons. Here's mine, which is configured for pulseaudio and for Totem: my /etc/lircrc.
Setting up PulseAudio
Edit /etc/pulse/default.pa and add the following:
.ifexists module-lirc.soNote, that if you have more than one audio device, you'll need to list the sink here. To find out what sink you should use, run "pacmd" and then, at the prompt, "list-sinks". Look for the device that you want to control with your remote and copy the "name" without the angle brackets. You'll need to add it to the load-module command, e.g. like so (for me):
load-module module-lirc config=/etc/lircrc
load-module module-lirc config=/etc/lircrc sink=alsa_output.pci_8086_27d8_sound_card_0_alsa_playback_0You'll need to restart pulseaudio to take effect -- you can just log out and log back in for that. If all went well, pressing volume buttons on the remote should now change volume on your mac mini.
That's easy -- just load it up and make sure the lirc plugin is enabled (Edit->plugins).
I'm planning on setting it up with Exaile, but I haven't yet had a chance to get around to that. I can see from the packages available that several other apps have lirc capabilities, e.g. rhythmbox and xmms, but I don't use either of these, so I didn't bother setting them up.
I just wish Miro supported it, but currently it doesn't. In fact, Miro is having issues under F9 at the moment, so I didn't even get a chance to try.
Hope this was helpful to others.