Setup Windows Media Center IR Remote for MythTV and XBMC

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

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

Each button press should reveal the name of the button being pressed on the remote, something like this
In case you are looking for a perfectly Linux compatible Media Center Remote, then you can buy  the one shown below with confidence, as it works seamlessly with Ubuntu 10.04 and Ubuntu 9.10 and probably all other too.
Now that you have ensured that your remote is compatible with Linux, we need to install lirc-x, do so by
sudo apt-get install lirc-x
Download and extract the contents of the file below in the ~/.lirc folder
It contains two files, irexec and irxevent (this is an empty file, so don’t worry if you see it to be empty). You might need to modify the button names if your remote has slightly different names for the buttons.
Next, download the zipped file below which has 4 scripts (,, and and extract their contents in ~/scripts (or /home/user_name/scripts folder.

You would have to change the permission of the files to make them executable, run

chmod +x *.sh

inside the ~/scripts folder. Also open 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.

include ~/.lirc/irexec
include ~/.lirc/irxevent

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
script to Startup Applications Preference from the System > Preferences menu.

You might also like

Install XBMC on Ubuntu 10.04 Lucid Lynx with Support for IR Remote XBMC is a powerful...
XBMC on Ubuntu vs XBMC Live: Wireless Network and IR Remote I have seen...
Enable Closed Caption (CC) / Subtitle on Live TV / Video Playback Unlike Windows...
Install XBMC Dharma on Ubuntu 10.10 or 10.04 with Live TV and IR Remote Support XBMC is a powerful...

About the Author

has written 346 posts on this blog.

Meditating towards his "nerdvana", lifehacker is a teacher by the day and a nerdy blogger by the night. He lives to learn and yearns to learn living.

5 Comments on “Setup Windows Media Center IR Remote for MythTV and XBMC”

  • ProfessorX wrote on 28 June, 2010, 15:54

    Great! Worked perfectly–and having the instructions as a pdf (and other formats) download is very helpful, too. Thanks for taking the time to put this together.

    Like or Dislike: Thumb up 0 Thumb down 0


  • lifehacker wrote on 28 June, 2010, 17:12


    Most welcome, we enabled pdf download to make out posts available to users offline.

    Like or Dislike: Thumb up 0 Thumb down 0



  1. How launch XBMC with MCE Remote “Home” Button on Ubuntu « Noods’s Blog
  2. Install XBMC on Ubuntu 10.10 Maverick Meerkat with IR Remote Support | Hack Your Life!
  3. Install XBMC Dharma on Ubuntu 10.10 or 10.04 with IR Remote Support | Hack Your Life!

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!


Copyright © 2017 Hack Your Life!. All rights reserved.
Proudly powered by WordPress. Developed by Deluxe Themes