First and foremost thing to be installed is the lirc package which supports the IR remotes in linux. Install it by doing (make sure your remote is not plugged at this instance, plug it in after the installation has finished)
sudo apt-get install lirc
The basic setup for Media Center remote integration with MythTV, XBMC and some other common programs like vlc, xine, totem etc can be achieved by installing mythbuntu-lirc-generator
sudo apt-get install mythbuntu-lirc-generator
Invoke it at a terminal by doing this
It would generate a bunch of files in ~/.lirc folder in your home directory, and also create a .lircrc file in ~/ or /home/user_name folder. That is all for the basic setup of the IR remotes.
For more advanced setup, and to control other applications, one needs to create ones own button -> function mapping and we would need to include couple of more configuration files in ~/.lircrc. I am going to show you how to use MCE Green button to launch MythTV, use another button say Red to launch XBMC and use the power button to shutdown your computer.
Before we begin, check whether your remote is getting detected properly, to test the IR remote buttons, launch a terminal and type in
sudo apt-get install lirc-x
You would have to change the permission of the files to make them executable, run
chmod +x *.sh
inside the ~/scripts folder. Also open startIRexec.sh file using a text editor and replace the string “user_name” with your own username.
Now you need to add the following lines to the ~.lircrc file at the end, you use any text editor to do so.
Lets test the scripts by starting them manually from terminal
Now you should be able to launch MythTV with the Green Media Center button.
Finally we want the irexec (and irxevent) to be auto-started at each boot. So, add this startIRexec.sh
script to Startup Applications Preference from the System > Preferences menu.