Help with really simple Ambx script - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +--- Thread: Help with really simple Ambx script (/showthread.php?tid=74272) |
Help with really simple Ambx script - abfmdf - 2010-05-20 I followed this great thread http://forum.xbmc.org/showthread.php?p=540108 and managed to get xbmc live working with ambx . The only problem is that I need to go into terminal and type these commands sudo boblightd export DISPLAY=:0.0 boblight-X11 I know it should be really easy writing a script so that I can execute it within xbmc but I just cant figure out how to do it. Tried all day !! I know im an idiot but any help would be great. - bobo1on1 - 2010-05-21 You can start boblightd in /etc/rc.local, I don't know where you can start boblight-X11 on xbmc live. - ronie - 2010-05-21 create a simple script: bob-start.sh Code: #!/bin/sh download and install the laucher plugin: http://forum.xbmc.org/showthread.php?tid=35739 create a launcher for your script and you're done. you can now execute the script using the launcher plugin. to start boblight with a single press of a button, map this command to a key on your remote: RunPlugin(plugin://programs/Launcher/?bob-start) - abfmdf - 2010-05-22 Thats a great help ronie I will give it a go this weekend. And thankyou bobo for making it possible (it works far better than I expected ) - abfmdf - 2010-05-23 Thanks for the help ronie, I now have ambx as a shortcut on favourites (via the launcher) and as a function on my remote. This is the shell script I used to get it to work: bob-start.sh Code: #!/bin/sh (adding password into script is not a problem for me, as my pc is only a HTPC) - Kode - 2010-05-25 Is it possible to get python to execute shell commands though, because then we could create a gui with like Speed: 10,20,30,40,50,60,70,80,90,100 Interval: 0.1,0.2,0.3,0.4,0.5 Brightness: 1,2,3,4,5,6,7,8,9,10 Saturation: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,29,20 then when you change a value it does: killall boblight-X11 boblight-X11 -s 5 -t 0.1 -a 20 -v 3 depending on what values were selected, could also have it save and load the settings and an enable on startup or something. I've not done any python coding before, but i'd have a go at it if it was possible, any ideas? - abfmdf - 2010-05-26 From what I have read, it should be a fairly straight forward process, although like you I have never programmed in python before (actually before I got my HTPC I hadn't programmed since my computing degree 10 years ago) The most elegant solution would be simply to pass the commands directly to the shell script, but in practice I dont know how easy that would be. A simpler solution might be to get the python script in the gui to write the variables into a text file (which should be fairly simple), Alter the shell script to read the variables in the text file, and have a separate python script in the gui which then starts/ stops the script Start shell script Code: import os Thats probably how I would approach it, but I am not the best person to advise. - Kode - 2010-05-27 hmm, something like the following might work then?: os.system('killall boblight-X11') os.system('boblight-X11 -s 5 -t 0.1 -a 20 -v 3') Will have a try tonight *edit* Or even Code: import xbmc, xbmcgui, os, time - Swifty - 2010-05-27 Kode, you might want to check with bob.. there is a branch of XBMC that has built in boblight functionality but I'm not entirely sure when (or if) this is due for release.. The adjustments you are after may already be included in that ? Also, you might want to put a pause between those two commands since I use something similar to stop and reload boblight but found I had to wait a second or two for boblight to close before trying to reload it. - Kode - 2010-05-27 Thanks for the advice Swifty. I did see somewhere that there was a branch with boblight built in, but i'd already installed combustd and boblight by then, so not sure what, if any advantages that would give me, unless it allows you to change parameters through the gui (which is what i'm guessing you are suggesting it might?) |