Linux Mint 11: Get Apple Remote working on a 27" iMac (11,1 late 2009)

go4unkwn
  12 years ago
  0

preconditions:

  • author has limited english knowledge
  • 27" imac i5, 11,1, late 2009
  • linux mint 11 installed and running
  • courage to use the command line
  • courage to use an editor, for example gedit
  • hint all commands will be red-bold

Every iMac has an built-in infrared receiver and the corresponding Apple Remote. On a MacOSX system the Apple Remote works out of the box. Not so under Linux Mint 11. In order to use your Apple Remote to adapt the sound volume - as you can do using your keyboard - you have to install the following packages:

  • lirc
  • xmacro
  • optional: gnome-lirc-properties (allows you to choose the type of the remote control)
  • if you install gnome-lirc-properties you have to install the package hal too. there is a bug in relation to gnome-lirc-properties and without hal gnome-lirc-properties won't run.

You can install the above mentioned packages with synaptic or on the command line using apt-get.

procedure:

  • apt-get install lirc xmacro gnome-lirc-properties hal
  • During the installation of lirc you will be asked to choose your type of remote control. choose Apple Mac mini USB Receiver
  • If you did a mistake in determing your remote control, you can always reconfigure lirc with the following command: dpkg-reconfigure lirc. Then you can correct your mistake.
  • after the installation of the above mentioned packages open a terminal
  • in the terminal type the command: irw
  • now press some keys on your remote control, for example + - >>I I<<. in the terminal you should see some response. if not, sorry i can't help you.
  • in my case: key + response VOLUP / key - response VOLDOWN / key I<< response BACKWARD / key >>I response FORWARD / key >II response PLAY / key MENU response MENU
  • if there are other "names" in the reaction of pressing a key, write them down. we need them later.
  • now open gedit (gnome editor) an copy the following code (blue):

begin
    prog = irexec
    button = VOLUP
    config = echo KeyStrPress XF86AudioRaiseVolume KeyStrRelease XF86AudioRaiseVolume | xmacroplay $DISPLAY
end

begin
    prog = irexec
    button = VOLDOWN
    config = echo KeyStrPress XF86AudioLowerVolume KeyStrRelease XF86AudioLowerVolume | xmacroplay $DISPLAY
end

begin
    prog = irexec
    button = PLAY
    config = echo KeyStrPress XF86AudioPlay KeyStrRelease XF86AudioPlay | xmacroplay $DISPLAY
end

begin
    prog = irexec
    button = FORWARD
    config = echo KeyStrPress XF86AudioNext KeyStrRelease XF86AudioNext | xmacroplay $DISPLAY
end

begin
    prog = irexec
    button = BACKWARD
    config = echo KeyStrPress XF86AudioPrev KeyStrRelease XF86AudioPrev | xmacroplay $DISPLAY
end

 

  • hint: because of my limited knowledge in using the editor for this howto the line config = echo may be wraped. so the line beginning with config = echo is a single line til $DISPLAY
  • hint: all words beginnig with XF86Audio you can find as menu entry "key combinations" (in german: Tastaturkombinationen) under the menu preferences (in german: Einstellungen). if something doesn't work, check if the XF86Audio are there.
  • hint: if your remote key response names (VOLUP ...) differ adapt them in the code.
  • now save the code as a hidden text file below your home directory /home/yourname/.lircrc as you can see you have to call the hidden text file .lircrc
  • in order to test if you can control now your sound volume go back to the terminal use the command: irexec -d
  • i succeeded, hopefully you too
  • I forgot to say: till now irexec will not run on startup! so you have to execute the command irexec -d everytime you are loged in. I already mentioned i am using the german version of Linux Mint. in my case I can add irexec -d to "Startprogramme" so that irexec -d start up when I log in. Of course ther must be an english "version" of "Startprogramme". You should find it in the Preferences Menu. Add the command irexec -d there.

all credits go to Lucas sein virtuelles Zuhause