[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - 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) +---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152) +---- Thread: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) (/showthread.php?tid=151011) |
[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - pilluli - 2013-03-29 (2013-03-28, 16:21)fernandovg Wrote: Can I run this infinite loop script in you add-on? Shouldn't be a problem. I see you already tried and it is working. Glad it also works for you! RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - fernandovg - 2013-03-29 Is it possible to add multiple scripts "per category"? [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - pilluli - 2013-03-29 (2013-03-29, 16:40)mbw2001 Wrote: Would it be possible to catch the "Put display to sleep when idle" from Power Saving? Sorry don't really understand. You don't want to use the "screensaver start" callback but another one which is related to the "put display to sleep"?? I don't know if xbmc publishes that callback to addons though... But I'll check anyway... RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - pilluli - 2013-03-30 (2013-03-29, 19:42)fernandovg Wrote: Is it possible to add multiple scripts "per category"? What do you mean "per category"? You mean by knowing if a movie or audio is playing? If so you can already do something similar as the scripts execute with an argument telling if the item played is video or audio. Regards, Re: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - fernandovg - 2013-03-30 No. More than one script at Xbmc Startup, etc RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - spoyser - 2013-03-30 (2013-03-30, 14:13)fernandovg Wrote: No. More than one script at Xbmc Startup, etc Just have it start a script that then starts all the scripts you want. RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - hallonterror - 2013-04-11 This script seems very promising. I previously used an external method to detect changes in the state of XBMC, but this plugin would improve and simplify what I'm trying to do. I have a Raspberry Pi running Xbian. I have installed something called WiringPi that allows access to the GPIO pins without root or sudo. From the terminal I am able to call Code: >> /home/xbian/init.sh to init the correct pins as outputs, turn them on and then off again. There are no errors as far as I can see in the XBMC log. The content of the script files are very rudimentary; Code: #!/bin/bash Takes care of setting the pins while the following changes the state to on or off: Code: #!/bin/bash Code: #!/bin/bash The strings shown to me in the settings for the plugin shows the exact same paths as used above, when manually running the scripts. I have set the init script to run at start and the other two when the screensaver stops or starts. I downloaded the latest available version from the homepage today (2013-04-11). Am I doing something fundamentally wrong? The states of the pins just wont change... RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - fernandovg - 2013-04-11 Try ssh and: sh on.sh See the result RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - hallonterror - 2013-04-13 I did. Code: >>sh on.sh RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - dven - 2013-04-24 script on "Player starts" execute twice: Code: 21:35:51 T:140389381601152 DEBUG: CAnnouncementManager - Announcement: OnPlay from xbmc please, help fix it RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - TheCooK - 2013-04-28 Thanks for the great script! It saved my day... now i can use my zwave dimmer to control light Scenes when watching a movie... i made three Versions of the same small console application to call an URL... i dont know if anyone will use this, but why not post it here: Code: using System; of course you guys Need to set "URL" to whatever you want to call... the above Thing turns my light on to "99" % one more Thing... if you want to avoid a console window when starting the .exe - in Visual Studio just go to Project Settings and set "Output" to "Windows Application" ... and its gone! Thanks again! TheCooK edit by Kib: I added some proper code tags RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - ajoburg - 2013-05-25 Are the scripts specified by setting value="/path/to/my/script" in the resources/settings.xml file (as described here)? My file is as follows...and the addon loads...but no scripts are logged. Any ideas? settings.xml Code: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> xbmc.log Code: 23:29:36 T:2929574976 DEBUG: XBMC callbacks: script version 0.2 started RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - matbor - 2013-06-05 Couple of quick questions... * will this run python scripts? * will it work on ATV2? The reason for my two questions are that I have a couple of Python scripts on my ATV2 that I can run from within XBMC -> System -> File Manager -> (Navigate to the same directory as below) -> xbmc_play.py and they work perfectly fine, they do what I want them to do. But when I add them to your plugin, I can see it calling the scripts but it doesn't do anything else! Part of the Log; (have full log if u need it, but can't see any other XBMC callbacks) Code: 22:52:50 T:145391616 DEBUG: XBMC callbacks: player starts Thx Matt. RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - pilluli - 2013-06-11 It does work on python scripts (actually, all of mine are python) Could you paste the first 3-4 lines of the script? The script needs to be marked as executable, meaning, that you should be able to run it stand-alone. Mine look llike this: Code: #!/usr/bin/env python (2013-06-05, 12:48)matbor Wrote: Couple of quick questions... RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - matbor - 2013-06-12 my settings.xml my xbmc_play.py (which I changed to look like yours) my original xbmc_stop.py (I later added the test_stop.py script to the this) my test_stop.py script<-- This just writes to the xbmc.log file with a print statement does nothing else. (PRINTs "XBMC TEST STOP SCRIPT" to the xbmc.log file when run) my file permissions (note, haven't done them all) my xbmc log file The logfile; @21:52:41 T:150085632; I manually run the script 'test_stop.py' from within XBMC's file manager and it works fine. @21:53:16 T:105340928; you can see where I kicked off a video and it calls the xbmc_play.py file but doesn't do anything. @21:53:23 T:105340928; you can see here that I stopped the video and it again calls the test_stop.py file but again doesn't do anything. (it is only meant to write to the logfile ) Couple of notes. * All the scripts that I have written work fine from within the xbmc file manager. * I can't run any python script from the commandline (via SSH), but I think that is because I use ATV2's (correct me if i'm wrong here) Hope this helps! |