Posts Tagged ‘button’

How to launch Boxee with MCE Remote (Windows)

Found a neat little install for launching Boxee with your MCE remote green button (usually launches WMC). Simply download and install!

http://inchoatethoughts.com/launching-boxee-with-a-windows-media-center-remote

Thanks Jacob Johnston!

How launch XBMC with MCE Remote “Home” Button on Ubuntu

Having recently installed ubuntu on my HTPC I was keen to get my Microsoft MCE Remote Control working. Initially this is easy to setup with LIRC but its a little trickier to get the buttons mapped the way you want. There is a lot of documentation on the web which doesnt seem to work.

I following the guide here with a few tweaks of my own: http://www.hackourlives.com/setup-windows-media-center-remote-for-mythtv-and-xbmc/

Im only interested in launching XBMC with the “Home” button on the remote, the power button will close XBMC with the default setup.

My setup:

Microsoft MCE Remote with USB IR Receiver
HTPC: Dell Hybrid
Version of ubuntu:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION=”Ubuntu 9.10″

Here are the steps:

1: Install the LIRC package which supports IR remotes for linux

$ sudo apt-get install lirc lirc-modules-source

You will then next to select the correct remote in the GUI which pops up.

2: For basic setup for media centre remote integration with xbmc and mythtv etc install the following:

$ sudo apt-get install mythbuntu-lirc-generator

and run in a terminal:

$ mythbuntu-lircrc-generator

According to the source this creates a .lirc directory and .lircrc file. However in my experience it created a txt file .lirc and no .lircrc. I removed the txt file .lirc and created a directory .lirc and txt file .lircrc in my home account

$ mkdir .lirc
$ touch .lircrc

3: Ensure the remote/receiver is now working, in a terminal window:

$ irw <return>

Now press some buttons on the remote such as “Home” and “Play” and you should see the button codes | names | mceusb

4: Now cd into your .lirc directory and create these two files

$ touch irexec
$ touch irxevent

5: Edit the irexec and enter the following:

# Start XBMC
begin
prog = irexec
button = Home
config = ~/scripts/startXBMC.sh &
end

6: Make another directory in your home account called scripts

$ mkdir scripts

7: cd into this directory and make two files, one called startIRexec.sh & another called startXBMC.sh

8: Edit startXBMC.sh and enter the following:

#!/bin/bash

# Test to see if XBMC is running first
if ps -ef|grep -v grep|grep -i xbmc.bin
# if ps -ef|grep -v grep|grep -i mythfrontend.re
then
# Do nothing
echo “XBMC already Running!”
else
# Startup MythTV
xbmc
fi
exit

9: Edit startIRexec.sh and enter the following:

#!/bin/bash

# Test to see if IRXevent is running first, if so kill it, then restart
if ps -ef|grep -v grep|grep -i irxevent
then
ps aux|grep -i user_name|grep -i irxevent |awk ‘{print $2}’|xargs kill
else
# Do nothing
echo “irxevent already dead!”
fi

# Test to see if IRexec is running first, if so kill it, then restart
if ps -ef|grep -v grep|grep -vi start|grep -i irexec
then
ps aux|grep -i user_name|grep -i irexec |grep -vi start|awk ‘{print $2}’|xargs kill
else
# Do nothing
echo “irexec already dead!”
fi

#test to see if an instance of irxevent is already running
if ps -ef|grep -v grep|grep irxevent
then
# do nothing
echo “irxevent already running”
else
# start irxevent
irxevent ~/.lircrc &
fi

#test to see if an instance of irexec is already running
if ps -ef|grep -v grep|grep irexec
then
# do nothing
echo “irexec already running”
else
# start irxevent
irexec -d ~/.lircrc &
fi

exit

10: Edit the startIRexec.sh file and replace all user_name entries with your user name.

11: Make sure both scripts are executable:

$ chmod +x *.sh

12: Add the following lines to the .lircrc file in your home account

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

13: Manually execute the startIRexec.sh script

$ ~/scripts/startIRexec.sh

With any luck you should now be able to launch XBMC with the “Home” button on the MCE remote 🙂

To ensure that the irexec script starts when you login:

System > Preferences > Startup Application

The application to launch is /home/username/scripts/startIRexec.sh

Enjoy your new remote!