2013-12-28, 01:54
Steam, Linux and Lirc
Steam BPM running on Linux doesnt detect remote keypresses via Lirc (although if you are not using Lirc and only the in-kernel drivers Steam will probably respond). One way around this is to use irxevent, which is a program "to send button clicks and key presses to X applications triggered by a LIRC driven remote control." Once this is configured, when irxevent is running your remote will send key key presses as well the Lirc keypresses (this can cause problems with xbmc, see below).
First off create a lirc config file:
nano ~/.lircrc
And paste in something like the following:
To find out which remote keypress corresponds to 'button =' use the program irw. For a list of keysymbols to use for 'config =' see here and here.
As mentioned above running irxevent with programs that use Lirc input (eg xbmc) will result in double keypresses. I work around this by modifying steam-launch.sh to only run irxevent when Steam BPM is running:
After this you should be able to control Steam BPM, along with other programs such as Chrome and games/emulators with your remote control.
UPDATE: After having issue with irxevent not launching with chromium Ive changed how I run it. I run this script as my user from /etc/rc.local and it runs in the background. With this script there is no need to edit steam-launch.sh to run irxevent.
Steam BPM running on Linux doesnt detect remote keypresses via Lirc (although if you are not using Lirc and only the in-kernel drivers Steam will probably respond). One way around this is to use irxevent, which is a program "to send button clicks and key presses to X applications triggered by a LIRC driven remote control." Once this is configured, when irxevent is running your remote will send key key presses as well the Lirc keypresses (this can cause problems with xbmc, see below).
First off create a lirc config file:
nano ~/.lircrc
And paste in something like the following:
Code:
###irxevent
begin
prog = irxevent
button = KEY_UP
repeat = 1
config = Key Up CurrentWindow
end
begin
prog = irxevent
button = KEY_DOWN
repeat = 1
config = Key Down CurrentWindow
end
begin
prog = irxevent
button = KEY_LEFT
repeat = 1
config = Key Left CurrentWindow
end
begin
prog = irxevent
button = KEY_RIGHT
repeat = 1
config = Key Right CurrentWindow
end
begin
prog = irxevent
button = KEY_PLAY
config = Key Return CurrentWindow
repeat = 1
end
begin
prog = irxevent
button = KEY_ENTER
config = Key Return CurrentWindow
repeat = 1
end
To find out which remote keypress corresponds to 'button =' use the program irw. For a list of keysymbols to use for 'config =' see here and here.
As mentioned above running irxevent with programs that use Lirc input (eg xbmc) will result in double keypresses. I work around this by modifying steam-launch.sh to only run irxevent when Steam BPM is running:
Quote:.....
echo Kill XBMC
kill -9 $(pidof xbmc.bin) #There are better ways of doing this but this is the most consistent
echo "Shutdown XBMC"
if [ ! $(pidof irxevent) ]
then
irxevent &
fi
echo Is Steam running?
.....
Quote:.....
while [ $(wmctrl -l | grep "$STEAM_WIN_ID") ]; do
echo "Steam BPM running!"
sleep 1
done
if [ $(pidof irxevent) ]
then
kill -9 $(pidof irxevent)
fi
if [ $(pidof xbmc.bin) ] ; then
.....
After this you should be able to control Steam BPM, along with other programs such as Chrome and games/emulators with your remote control.
UPDATE: After having issue with irxevent not launching with chromium Ive changed how I run it. I run this script as my user from /etc/rc.local and it runs in the background. With this script there is no need to edit steam-launch.sh to run irxevent.
Code:
#!/bin/bash
export DISPLAY=:0
while true; do
if [[ $(pidof xbmc.bin) ]]; then
if [[ $(pidof irxevent) ]]; then
kill $(pidof irxevent)
echo Killing irxevent, xbmc running
else
echo Xbmc running, irxevent not running.
fi
else
if [[ ! $(pidof irxevent) ]]; then
irxevent -d /home/xbmc/.lircrc
echo Starting irxevent, xbmc + irxevnet not running.
else
echo irxevent running, xbmc not running.
fi
fi
sleep 1
done