2011-03-05, 05:27
The following is how I start XBMC using the remote on a non-dedicated "normal" computer from the Gnome desktop. The launcher script might seem a little obscure, but Works For Me .
Biggest problems were that lirc sends duplicate events somehow (and thus the launcher script protects itself against it). Also all lirc events handled while XBMC is running seem to get stacked up and replayed as soon as you quit XBMC — effectively starting XBMC again right away. This is also handled, by ignoring these events while XBMC is running.
Finally, the script sets the master audio volume to 100%, so the XBMC volume control can use the full volume range (don't know if that is needed in every setup).
First you have to create the launcher script, in " ~/etc/launch-xbmc" (or another path of your choice):Make it executable, and then add it to your "~/.lircrc" as follows: Save it, and press the "Home" button on your remote...
Biggest problems were that lirc sends duplicate events somehow (and thus the launcher script protects itself against it). Also all lirc events handled while XBMC is running seem to get stacked up and replayed as soon as you quit XBMC — effectively starting XBMC again right away. This is also handled, by ignoring these events while XBMC is running.
Finally, the script sets the master audio volume to 100%, so the XBMC volume control can use the full volume range (don't know if that is needed in every setup).
First you have to create the launcher script, in " ~/etc/launch-xbmc" (or another path of your choice):
Code:
#! /bin/bash
pid=$(ps auxw | grep $0 | grep -v grep | tr -s ' ' | head -n1 | cut -f2 -d' ')
stamp="$(date '+%Y-%m-%d %H:%M:%S,%N')"
now="$(date '+%s')"
if test $pid != $$; then
echo "$stamp Ignoring dupe start (pid=$$; winner=$pid)" >>/tmp/xbmc-launcher.log
elif test -z "$(pidof /usr/lib/xbmc/xbmc.bin)"; then
echo "$stamp Starting XBMC" >>/tmp/xbmc-launcher.log
amixer sset Master,0 100%
xbmc &
else
echo "$stamp XBMC already running" >>/tmp/xbmc-launcher.log
fi
sleep 0.05
Code:
begin
prog = irexec
remote = *
button = Home
repeat = 0
config = ~/etc/launch-xbmc
end