[LINUX] Switching between Boxee and XBMC via Remote Control (lirc)?
#1
I really enjoy some specific features from both xbmc and boxee...

Is it possible to program a button (I have an MCE remote) that will execute a script which would then determine if one is on, stop it and start the other? Maybe something like having a random key not used map to a script like this

Code:
#!/bin/bash
# check daemon
ps -ef | grep -v xbmc
# if  found kill it and start boxee
if [ $? -eq 0 ]
then
killall XBMC; boxee
#otherwise, stop boxee and start xbmc
else
killall boxee; xbmc
fi

I pieced that together from random google searches - I know it won't work, just using it as an example...

Anyone want to help out? Nod
Reply
#2
Here's a thread that describes using remote buttons to kill and restart XBMC:
http://forum.xbmc.org/showthread.php?tid=30230

It should be fairly simple to modify for your needs.
Reply
#3
Got it working, thanks! I can quickly jump to XBMC for local content and eye candy, and jump back to Boxee for some online feeds from the remote.

For the others that want to do this... This will work, but I'm sure there are better ways of doing it though.

(replace "user" with the username that is used to start these processes)

Kill xbmc and start Boxee

Code:
!/bin/bash

# Test to see if XBMC is running first
if ps -ef|grep -v grep|grep -i xbmc.bin
then
# Try a clean kill
ps aux|grep -i user|grep -v grep|grep -i xbmc.bin|awk '{print $2}'|xargs kill
echo `date` "Killed XBMC! (soft)" >> /tmp/killXBMC.log
else
echo "XBMC already dead! (soft)"
exit
fi

# takes a second or two to die with the soft kill
sleep 2

# Test to see if it's still running
if ps -ef|grep -v grep|grep -i xbmc.bin
then
# If it's still around, kill it -9
ps aux|grep -i user|grep -v grep|grep -i xbmc.bin|awk '{print $2}'|xargs kill -9
echo `date` "Killed XBMC! (hard)" >> /tmp/killXBMC.log
else
DISPLAY=:0 /opt/boxee/run-boxee-desktop &
exit
fi

Kill Boxee, start XBMC.

Needed to start xbmc first before stopping boxee for some reason. Also commented the first attempt to stop the process through troubleshooting as this simply was not working. The 3rd to last line is not doing anything, the script stops before getting to it.

Code:
!/bin/bash
DISPLAY=:0 xbmc &
# Test to see if Boxee is running first
#if ps -ef|grep -v grep|grep -i Boxee
#then
# Try a clean kill
#ps aux|grep -i user|grep -v grep|grep -i Boxee|awk '{print $2}'|xargs kill
#echo `date` "Killed Boxee! (soft)" >> /tmp/killBOXEE.log
#else
#echo "Boxee already dead! (soft)"
#exit
#fi

# takes a second or two to die with the soft kill
#sleep 4

# Test to see if it's still running
if ps -ef|grep -v grep|grep -i Boxee
then
# If it's still around, kill it -9
ps aux|grep -i user|grep -v grep|grep -i Boxee|awk '{print $2}'|xargs kill -9
echo `date` "Killed BOXEE! (hard)" >> /tmp/killBOXEE.log
else
DISPLAY=:0 xbmc &
exit
fi


The "DISPLAY=:0" is useful if your testing from SSH (by manually running it) so it doesn't attempt to open on the console. Not sure if it serves any other purpose. Also not sure if this will eventually F*** anything up by which these processes are stopping (-9).
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] Switching between Boxee and XBMC via Remote Control (lirc)?0