2013-06-22, 02:46
This is the script I use in Openelec3.2 to start Boblight, launching it with irexec. The xbmc boblight addon needs to be enabled. The script starts boblightd and boblight-x11 so there is boblight in menus and visualisations, as well as in videos.
Code:
# cat .scripts/xbmc-boblightx11.sh
#!/bin/sh
#Script to start stop boblight with irexec
if [ ! "$(pstree |grep -i boblight-X11)" ]
then
/bin/killall -q boblightd ;
/bin/killall -q boblight-X11 ;
export LD_LIBRARY_PATH=/storage/.xbmc/addons/service.multimedia.boblightd/lib
export DISPLAY=:0
/storage/.xbmc/addons/service.multimedia.boblightd/bin/boblightd -f -c /storage/.config/boblight.conf ;
/usr/bin/xbmc-send --host=localhost --port=9777 --action="PlayerControl(Stop)" ;
/bin/sleep 2 ;
/bin/killall -q xbmc.bin ;
/bin/sleep 3 ;
/storage/.xbmc/addons/service.multimedia.boblightd/bin/boblight-X11 -f -x -o speed=70 -o value=10 -o saturation=1.0 -o threshold=10
else
/bin/killall -q boblightd ;
/bin/killall -q boblight-X11 ;
/usr/bin/curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Boblight","message":"Disabled"}}' http://localhost:9191/jsonrpc ;
fi