Merge branch 'master' of github.com:OpenELEC/OpenELEC.tv

This commit is contained in:
Stephan Raue 2012-03-15 13:22:41 +01:00
commit 7e0b6998f1
6 changed files with 121 additions and 24 deletions

View File

@ -1,3 +1,7 @@
2.0.5
- add possibilty to start / stop addon from addon manager with enable / disable
- restart boblightd on sleep / resume
2.0.4
- Fixed so that boblightd will not start it's already running

View File

@ -19,8 +19,8 @@
################################################################################
PKG_NAME="boblightd"
PKG_VERSION="2.0.4"
PKG_REV="4"
PKG_VERSION="2.0.5"
PKG_REV="5"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://code.google.com/p/boblight"

View File

@ -37,30 +37,41 @@ BOBLIGHT_CONFIG="$ADDON_HOME/boblight.conf"
# Flag file to start boblight-x11 daemon
BOBLIGHT_X11="$ADDON_HOME/boblight.X11"
LOCKDIR="/var/lock/"
LOCKFILE="boblightd.disabled"
export LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH"
cp -R $ADDON_DIR/config/*.sample $ADDON_HOME > $LOG_FILE 2>&1
if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
rm -rf "$LOCKDIR/$LOCKFILE"
fi
if [ -f "$BOBLIGHT_CONFIG" ] ; then
if [ ! "$(pidof boblightd)" ]; then
if [ -e $BOBLIGHT_CONFIG ]; then
while [ true ] ; do
if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
break
fi
# Make sure the xserver has started up
wait_for_xorg
# Start the boblight daemon
boblightd -c $BOBLIGHT_CONFIG -f >> $LOG_FILE 2>&1
fi
boblightd -c $BOBLIGHT_CONFIG >> $LOG_FILE 2>&1
done &
fi
if [ ! "$(pidof boblight-X11)" ]; then
if [ -e $BOBLIGHT_X11 ]; then
if [ ! "$(pidof boblight-X11)" ]; then
while [ true ] ; do
if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
break
fi
# Make sure the xserver has started up
wait_for_xorg
# Start the boblight daemon
boblight-X11 -f >> $LOG_FILE 2>&1
boblight-X11 >> $LOG_FILE 2>&1
done &
fi
fi
fi

View File

@ -0,0 +1,37 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
LOCKDIR="/var/lock/"
LOCKFILE="boblightd.disabled"
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
if [ "$(pidof boblightd)" ];then
killall -9 boblightd
fi
if [ "$(pidof boblight-X11)" ];then
killall -9 boblight-X11
fi

View File

@ -21,12 +21,23 @@
import os
import sys
import xbmcaddon
import time
import subprocess
__scriptname__ = "Boblightd"
__author__ = "OpenELEC"
__url__ = "http://www.openelec.tv"
__settings__ = xbmcaddon.Addon(id='service.multimedia.boblightd')
__cwd__ = __settings__.getAddonInfo('path')
__path__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "boblightd.service") )
__start__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "boblightd.start") )
__stop__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "boblightd.stop") )
os.system(__path__)
#make binary files executable in adson bin folder
subprocess.Popen("chmod -R +x " + __cwd__ + "/bin/*" , shell=True, close_fds=True)
subprocess.Popen(__start__, shell=True, close_fds=True)
while (not xbmc.abortRequested):
time.sleep(0.250)
subprocess.Popen(__stop__, shell=True, close_fds=True)

View File

@ -0,0 +1,34 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
case "$1" in
hibernate|suspend)
boblightd.stop
;;
thaw|resume)
xbmc-send --host=127.0.0.1 -a "XBMC.RunScript(service.multimedia.boblightd)" &
;;
*) exit $NA
;;
esac