• 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 23
[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)
#46
matbor,

Make sure of two things:

1. That you can execute the scripts from the command line. So something like "./power.sh" does execute the script.

2. That you write the *entire* path into the script. So if the file "power.sh" is in the folder "/home/user/scripts/" then you write this to the addon:

"/home/user/scripts/power.sh".

It should work like this! Regardsm
Reply
#47
oke, first error solved, driver issue.

Now, i have two .sh scripts, the first create the home/xbmc/callback/screensaver_off file,the second is called rem.sh and al it does is:

Code:
GNU nano 2.2.6                              File: rem.sh

#/bin/sh
rm /home/xbmc/callback/screensaver_off

when i ls /home/xbmc/callback/ i get this:
Code:
xbmc@mediacenter:~$ ls -l /home/xbmc/callback
total 0
-rw-rw-r-- 1 xbmc xbmc 0 Jul 14 22:51 screensaver_off
xbmc@mediacenter:~$

and when i run ./rem.sh the file is removed, but when i put it to callback addon, to the screensaver stops. It dont removeds it!

Yes, im using full paths. and execute on rem.sh is everyone. what else might be off?
Reply
#48
Applescripts won't get executed.
Bash scripts are working.
Reply
#49
(2013-07-18, 13:48)bigbadrabbit Wrote: Applescripts won't get executed.
Bash scripts are working.

Nevermind. Found a way to execute the Applescript from inside a bash script. Now it's working.
Although it would be nice to have native Applescript support sometime.

Thanks for this great add-on!
Reply
#50
Could you also add a XBMC Stops action, please?
Reply
#51
(2013-07-18, 15:55)bigbadrabbit Wrote: Nevermind. Found a way to execute the Applescript from inside a bash script. Now it's working.
Although it would be nice to have native Applescript support sometime.
Thanks for this great add-on!

Great you found a way! I only test the addon on linux (raspberry)...

(2013-07-18, 21:04)bigbadrabbit Wrote: Could you also add a XBMC Stops action, please?

Unfortunately I cannot find a reliable way to create that action. It does exist in the XBMC API but what happens is that sometimes XBMC quits *before* the script is executed...

Regards,
Reply
#52
pilluli, can you test something for me? i can not seem to remove/delete the screensaver_off file, although all scripts and permissions are double checked! try ed python script, and bash, and bash triggering the python.. nothing. Can you do it on the rasp? my scripts are working in terminal, paths are full and double checked too.
Reply
#53
i got the feeling thats a no...

Anyone else can help? that would be greatly appreciated, im really curious to find out if it is my noobiness or that there are other forces at work here..

kinda stuck here Sad
Reply
#54
Great script!! Pillulli, works good for me. One request or how to question i do have. Hope someone can help.
The player actions work for both video and audio. I would like to know how i can use it just for video.

Ahhh found it myself..... type=music
Reply
#55
(2013-10-23, 13:57)hansipi Wrote: Great script!! Pillulli, works good for me. One request or how to question i do have. Hope someone can help.
The player actions work for both video and audio. I would like to know how i can use it just for video.

Ahhh found it myself..... type=music

Yes, I was too late to answer... Smile

I use something like this in my scripts (python) to execute only for videos (not music):

Code:
#!/usr/bin/env python

if not 'music' in sys.argv[1]:
    # Do something
Reply
#56
Thanks for the work!

I've just made my raspbmc turn off my tv when it's idle (linking it to my screensaver).

If anyone is interested on how...

Linked "Screensaver starts" with this script:
Code:
#!/bin/sh

echo "standby 0" | cec-client -s -d 1 >> /dev/null

And "Screensaver stops" with this other script:
Code:
#!/bin/sh

echo "on 0" | cec-client -s -d 1 >> /dev/null

You do need a CEC compatible TV but I like my tv to turn off when I fall asleep or go out and turn it back on with the xbmc remote...
Reply
#57
This is really a great idea, I found it only now.

I'd like to use your addon to intercept a play on a music file and then show a specific window, but mp3 playing must not be stopped-
Is it possible?
How?
Reply
#58
(2013-12-14, 13:16)realtebo Wrote: This is really a great idea, I found it only now.

I'd like to use your addon to intercept a play on a music file and then show a specific window, but mp3 playing must not be stopped-
Is it possible?
How?

Right now the addon will execute an script (any script you set up in the preferences) whenever a file starts playing (file being a video or a music file). The script can now if it is a video or a music file as the script is executed with an argument saying "video" or "music". You can then do whatever you want in the script, like showing a specific window!!

Hope it helps
Reply
#59
Thanks.

It could be usefull if I can 'attach' my script to your script programmatically, without user interaction...
Reply
#60
I guess you could always create the file "settings.xml" in the addon_data folder yourself with the script name and callback. That way there is no need to configure the add on manually.

Regards
Reply
  • 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 23

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)4