Launch Program on XBMC/Kodi startup?
#1
Hi,

I have a program which I'd like to run each time XBMC is started, are there any addons that I can configure to launch a program or batch file when XBMC starts?

I'm already using XBMCLoader, but that only runs the programs when XBMCLauncher starts - not XBMC.



Cheers
Reply
#2
Maybe this can help you? --link--
Reply
#3
(2014-10-05, 23:32)WeirdH Wrote: Maybe this can help you? --link--

Thanks, I'll take a look
Reply
#4
WeirdH is absolutely right!
You can do a ton of stuff in the autoexec.py. Here's an example of what you can do with autoexec.py:

http://pastebin.com/ky5i7B8Z

This code checks to see if an xml file is out of date and if it is runs a batch called mk_xmltv.bat as a subprocess in a background (hidden) window to rebuild a tvguide xmltv.xml and then clears some database tables so that the next time the tvguide addon runs it will automatically update the listings tables.

You can communicate with the batch through subprocess.communicate() if needed. It's sometimes easier to just write what you need into a batch file then execute it. There's a lot of flexibility.
Reply
#5
Brilliant, exactly what I'm after
Reply
#6
I'm glad I found this thread. From skimming through the Kodi wiki's addon development section multiple times, I was under the impression that I was going to have to write a kodi service if I wanted to do some custom behaviour on startup.
Reply

Logout Mark Read Team Forum Stats Members Help
Launch Program on XBMC/Kodi startup?1