Apple Remote on a Macbook 2,1 (Mandriva 2010 KDE)

I finally configured lirc on my computer, and it works excellent --even better than in Mac OS X (still miss the frontrow though). I will try to show how I set it up for Amarok and Openoffice presentations in a friendly way. It's a long process, but very worthwhile. Very Happy

First, bear in mind that Lirc is still not even in its 1.0 version. The latest Mandriva one is 0.8.6. Although the inner workings of Lirc are quite stable, you still need to do text configuration.

Ok. First off, Install lirc.

1)Open Install & Remove Software and tick Lirc and Lirc-kernel-(your desktop)-latest. Click install and let it rip.

That's it. Now comes the annoying part.

2) Go to www.lirc.org and click a link named "supported remote controls". Now a bunch of files will appear: choose the apple one, then select lircd.conf.macmini. A bunch of text should appear -copy-paste it into a new kwrite document and save it as lircd.conf. For ease-of-understanding purposes, move the file to the Desktop folder.

3) Open Mandriva Control Center (MCC), choose the system tab and open a console as administrator (any console/terminal can work, provided you know how to access administrator mode). In the console, type cd ~/Desktop (the tilde is needed, just means YOUR home folder, /home/username). Then type: cp (copy) lircd.conf /etc/lirc/lircd.conf. If it asks you to overwrite, go ahead: you're just erasing lirc's placeholder saying to do what you just did.

4) Now close the kwrite window, and in the console type: kwrite (or any "wordpad" you have on, this is the default in Mandriva 2010 KDE) /etc/sysconfig/lircd. This is to add a notice for the driver you use in the system. In the "DRIVER" field, write macmini between the quotes, and in the HWMOD, write lirc_dev between the quotes. Also, if you see an UNCOMMENTED line (WITHOUT a NUMBER SIGN) saying /dev/lirc/0 iinstead of /dev/usb/hiddev0, change it to /dev/usb/hiddev0. Save and close when the changes are done.

5) Now close the console and install the kdelirc package. It provides a nice way to configure applications to use lirc. then reboot.

6) Now it's testing time. You will need to open two MCCs an access a console on one of them. In the first one we'll do the work, in the second one we'll do the testing Smile

In the first one, go to the system tab and click Manage system services. Find the one that says lircd, and hit stop on it. then close that pane (not the MCC!), then open a console as administrator.

Now type the line below this explanation (people using other terminals are in luck, they can copy-paste...). I don't want people to get lost, so it's better if they know what we're doing in the shell. lircd -n --driver= macmini (you're saying which driver you'll use) --device=lirc_dev (the module you'll use) /dev/usb/hiddev0 (the infrarred port) /etc/lirc/lircd.conf (the configuration you want). Here is the full command:

lircd -n --driver=macmini --device=lirc_dev /dev/usb/hiddev0 /etc/lirc/lircd.conf

After this tedious work (phew!) go to the second console and type: irw. Then get your Apple Remote and press some buttons. Be sure to point to the right of the Macbook and towards the IR receiver. If you see the names of the keys you saw in the /etc/lirc/lircd.conf (you can open it as a user to see) when you press the buttons, Congratulations!!! Lirc is done!!

If you had problems, verify the steps and type in a console: man (base command), so you know what you're doing.

All that's left is to put it in use for the applications. Fortunately, kdelirc has a way with amarok and the keys that seems quite pleasant, actually.

7) Close the testing MCC, and in the work one hit Ctrl + C to end the process. Then write: service lircd restart, to open the lircd service again. After, go to Configure your Desktop, then go to the Remote Controls option. If it asks you to start irkick do so, and you can figure the second dialog out. Here you should see the Apple A1156 listed as main. Click on the add button below the outline that says the control's name to add a mode. Name it "Amarok", and choose whether you want it default or not.

8) Now add options on the mode by clicking the add button below the remote's button list. You can add various options to the same button, provided they do not conflict. DO NOT AUTOFILL BECAUSE THE KEYS USED BY THE CONF ARE DIFFERENT FROM THE ONES SPECIFIED THERE. After setting the keys to your liking, add another mode called Presentations (be sure to specify a mode change button before this so you can use both modes): do not create any button for this one.

then copy this:

Code:
 

##############################################
#### Evince y OpenOffice (Presentations) ####
##############################################

begin
prog = irxevent
button = KEY_PLAYPAUSE
config = Key F5 CurrentWindow
repeat = 0
end

begin
prog = irxevent
button = KEY_MENU
config = Key Escape CurrentWindow
repeat = 0
end

begin
prog = irxevent
button = KEY_REWIND
config = Key Prior CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_FASTFORWARD
config = Key Next CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_VOLUMEUP
config = Key ctrl-plus CurrentWindow
repeat = 0
end

begin
prog = irxevent
button = KEY_VOLUMEDOWN
config = Key ctrl-minus CurrentWindow
repeat = 0
end

into a new text editor file named .lircrc (it's going to be hidden so you better have the show hidden files option on), and save it in /home/your username. DO NOT CLOSE IT YET! It's time to open in another kwrite the /etc/lirc/lircd.conf we're using. Change the key names in my file to the key names you see in lircd.conf, THEN Save and Close both kwrites (lircd.conf has no changes, so if asked discard all changes).

9) Open a konsole (last terminal you'll see if all went well) then type: cd ~/.kde4/Autostart, and after you see Autostart in the bracket, type: ln -s /usr/bin/irxevent -d to make irxevent run in background and let you control presentations. Close everything and do a last reboot (more for assurance than for necesssity).

10) Final step. After boot is done, switch to presentations mode, and open a presentation. It should work as expected. If not, try opening a terminal and typing: irxevent -d, then retrying.

Taxonomy upgrade extras: 
© 2002-2012 Jeroen Diederen. Drupal theme by Kiwi Themes.