How to send command by KODI?

Hi All,

I would like to know if there is a way to have an icon on Kodi and when I select it with my remote control it executes a shell command. This shell command is synchronous and I would like to receive a notification when it completes. Consider that in the meanwhile I would like to still use KODI.
Is there a way to implement this in OSMC?
Thanks.

http://kodi.wiki/view/List_of_built-in_functions
Check System.Exec

But maybe that is not what you are looking for because it seems you used that before

Yes, I did it some time ago with Retropie but I didn’t remember how. My SD card broken down and now I have a new one and for Retropie used the new Launch AddOn.

However, here what I need. I need to click on icon and launch a shell script. At the same time issue a pop up that command was received (this to prevent double click). Once the script complete a notification should be send.
I need this to a better management of my Photos where I use Flickrsmartsync to sync up my local folder with Flcikr.

I read the doc but I need exact steps, for example how to add the icon, how to associate the System.Exec command. What to put in the script to show the popup and what to put at the end of script to send notification of action completed.

http://kodi.wiki/view/JSON-RPC_API/#JSONRPC.NotifyAll

Conceptually it’s clear but I need to put it in practice so I need real example.
Let me report the exact questions:

  1. how I add an icon in Kodi so that I can click it and call System.Exec?
  2. Where should I write the System.Exit call that calls my scripts?
  3. Suppose my scripts executes N instructions, once it starts what I have to put in the top to send a message like this on KODI: “Flickr upload is started. You’ll be notified when the operation completes.” I need here a real example of code.
  4. What code I have to put at the end to send a notification with JSONRPC.NotifyAll in the top right of the screen with a message like this “Flickr upload successfully completed.” or “Flickr upload failed.”

I found a doc like this that answer to most of my questions, the problem is that with Estuary and Kody Krypton the istructions to add the Custom menu (or icon) does not match with my env:
http://www.multibootpi.com/info/how-to-add-a-custom-shortcut-in-kodi/

How can I do the same in Krypton?

Hi,

If you are using the Estuary skin, you would probably be better of asking at the kodi forums; being as that skin was made by the kodi team.

Thanks Tom.

Probably here I need two plugin like the Retropie Launcher created by @mcobit, one for Flickr upload and another for download. The only difference is that I have to call a different script. Or I could create a single plugin that does both (for me more difficult).

If you can use the apis from python or bash, you could write a kodi plugin yourself that just does the calls and then quits from time to time.
Or a plugin that runs a bash script that does the stuff in the background (detached) while kodi runs. And then use kodi-send to localhost to do the notification when finished.

Hi,

from a quick google search I found this:

http://forum.kodi.tv/showthread.php?tid=265010

You should allow you to add System.Exec shortcut. This is probably easier than a plug-in.

Are you still using flickrsmartsync? If so you possible add the Json to notification to sync.py

Thanks Tom.