Advertisement
Guest User

Untitled

a guest
Oct 17th, 2012
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. root ~/.xbmc/addons/service.multimedia.boblightd/bin # cat boblightd.start
  2. #!/bin/bash
  3.  
  4. ################################################################################
  5. # Copyright (C) 2009-2010 OpenELEC.tv
  6. # http://www.openelec.tv
  7. #
  8. # Boblightd addon maintained by Adam Boeglin: adamrb@gmail.com
  9. #
  10. # This Program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 2, or (at your option)
  13. # any later version.
  14. #
  15. # This Program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with OpenELEC.tv; see the file COPYING. If not, write to
  22. # the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
  23. # http://www.gnu.org/copyleft/gpl.html
  24. ################################################################################
  25.  
  26. . /etc/profile
  27.  
  28. ADDON_DIR="$HOME/.xbmc/addons/service.multimedia.boblightd"
  29. ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.multimedia.boblightd"
  30.  
  31. mkdir -p $ADDON_HOME
  32.  
  33. LOG_FILE="$ADDON_HOME/service.log"
  34.  
  35. # Boblight config file created by user
  36. BOBLIGHT_CONFIG="$ADDON_HOME/boblight.conf"
  37.  
  38. # Flag file to start boblight-x11 daemon
  39. BOBLIGHT_X11="$ADDON_HOME/boblight.X11"
  40.  
  41. LOCKDIR="/var/lock/"
  42. LOCKFILE="boblightd.disabled"
  43.  
  44. export LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH"
  45.  
  46. cp -R $ADDON_DIR/config/*.sample $ADDON_HOME > $LOG_FILE 2>&1
  47.  
  48. if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
  49. rm -rf "$LOCKDIR/$LOCKFILE"
  50. fi
  51.  
  52. if [ -f "$BOBLIGHT_CONFIG" ] ; then
  53. if [ ! "$(pidof boblightd)" ]; then
  54. while [ true ] ; do
  55. if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
  56. break
  57. fi
  58. # Make sure the xserver has started up
  59. wait_for_xorg
  60. # Start the boblight daemon
  61. boblightd -c $BOBLIGHT_CONFIG >> $LOG_FILE 2>&1
  62. done &
  63. fi
  64.  
  65. if [ -e $BOBLIGHT_X11 ]; then
  66. if [ ! "$(pidof boblight-X11)" ]; then
  67. while [ true ] ; do
  68. if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
  69. break
  70. fi
  71. # Make sure the xserver has started up
  72. wait_for_xorg
  73. # Start the boblight daemon
  74. # boblight-X11 >> $LOG_FILE 2>&1
  75. boblight-X11 -p 1 -s 192.168.1.17:19333 -o gamma=2.2 -o speed=40 -o valuemin=0.004 -o value=1.5 -o saturation=1.2 -o threshold=20 >> $LOG_FILE 2>&1
  76. done &
  77. fi
  78. fi
  79. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement