Kodi Community Forum
[RELEASE] Commands - Map multiple xbmc commands to one remote button - 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: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] Commands - Map multiple xbmc commands to one remote button (/showthread.php?tid=134129)

Pages: 1 2 3 4 5


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - AussieFries - 2012-11-03

Great work!

I'm trying to create an event which first sends the IR remote 'Stop', then the Suspend command.
('Stop' to stop what's currently playing in XBMC)

So to map above action to button '1' on my remote, I have to add below line to my keyboard.xml?

<one>RunPlugin(plugin://script.commands)</one>

Please find content of my commands. file below.

1###Stop#Suspend

Will this work?

Many thanks for your help


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - evenzak - 2013-02-07

Is it possible to map a combo command directly to a remote button by passing a parameter i.e. RunPlugin://script.commands/?combo_command_name? I often use the combo CleanLibrary(video)#RunScript(script.artwork.downloader) and I would like to execute directly from a button press rather than have the list of commands pop up. Thanks, and great work!


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - AddonScriptorDE - 2013-02-12

(2012-11-03, 21:17)AussieFries Wrote: Great work!

I'm trying to create an event which first sends the IR remote 'Stop', then the Suspend command.
('Stop' to stop what's currently playing in XBMC)

So to map above action to button '1' on my remote, I have to add below line to my keyboard.xml?

<one>RunPlugin(plugin://script.commands)</one>

Please find content of my commands. file below.

1###Stop#Suspend

Will this work?

Many thanks for your help
Hi! Yes, this should work...
Code:
<one>RunPlugin(plugin://script.commands)</one>
opens the "Commands" menu.
But I would replace the "1" with a better title...
This command will not be directly executed when pushing "1" on your remote...
Instead, a list with all your commands will appear...

(2013-02-07, 00:43)evenzak Wrote: Is it possible to map a combo command directly to a remote button by passing a parameter i.e. RunPlugin://script.commands/?combo_command_name? I often use the combo CleanLibrary(video)#RunScript(script.artwork.downloader) and I would like to execute directly from a button press rather than have the list of commands pop up. Thanks, and great work!
Currently, you cant directly map combo commands to one key...Sad But I can add something like that to the next version!


Re: [RELEASE] Commands - Map multiple xbmc commands to one remote button - evenzak - 2013-02-12

You're awesome! Thanks for all the hard work on this script!


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - aptalca - 2013-02-13

Just wanted to say thanks again

this addon increased the waf of my system greatly :-)


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - frank1119 - 2013-02-23

I like this addon, but I wanted to execute commands defined with this addon directly from my RC, so I modified the script /home/pi/.xbmc/addons/script.commands/default.py

I added this

Code:
def executeFunc(key,func):
        importCommands(key)
        myCommandsTemp=[]
        for temp in myCommands:
          if temp.find(func+"###")>=0:
            command = temp[temp.find("###")+3:]
            if command.find("#")==-1:
              xbmc.executebuiltin(command)
            else:
              spl=command.split("#")
              for temp in spl:
                xbmc.executebuiltin(temp)

And I replaced

Code:
params=parameters_string_to_dict(sys.argv[2])
key=params.get('key')

if type(key)!=type(str()):
  key=''

if key != '':
    commandsMain('_'+key)
else:
    commandsMain('')

with

Code:
params=parameters_string_to_dict(sys.argv[2])
key=params.get('key')
func=params.get('func')
if type(key)!=type(str()):
  key=''
if type(func)!=type(str()):
  func=''

if func != '':
  if key != '':
      executeFunc('_'+key,func)
  else:
      executeFunc(''+key,func)
else:
  if key != '':
      commandsMain('_'+key)
  else:
      commandsMain('')

Now you can modify the keyboard.xml like this:

<one mod="ctrl,alt">RunPlugin(plugin://script.commands/?func=CycleSubs)</one>

I hope the original developer feels not offended... Blush


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - MeMeMe - 2013-02-25

How do I download this addon?


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - AddonScriptorDE - 2013-02-25

(2013-02-23, 15:20)frank1119 Wrote: I like this addon, but I wanted to execute commands defined with this addon directly from my RC, so I modified the script /home/pi/.xbmc/addons/script.commands/default.py
Nice, thanks for your modification! Useful for combi-commands. (Every single-command could be directly mapped to a key without this addon...)
I will add this to the next version... (if you agree Wink)

(2013-02-23, 15:20)frank1119 Wrote: I hope the original developer feels not offended... Blush
Not at all! Smile

(2013-02-25, 15:04)MeMeMe Wrote: How do I download this addon?
You can install it via the xbmc.org repo:
Settings -> Add-ons -> Get Add-ons -> XBMC.org Add-ons -> Program Add-ons -> Commands


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - MeMeMe - 2013-02-25

(2013-02-25, 15:04)MeMeMe Wrote: How do I download this addon?
You can install it via the xbmc.org repo:
Settings -> Add-ons -> Get Add-ons -> XBMC.org Add-ons -> Program Add-ons -> Commands
[/quote]

Doh! Of course. Thanks


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - frank1119 - 2013-02-26

(2013-02-25, 15:58)AddonScriptorDE Wrote: Nice, thanks for your modification! Useful for combi-commands. (Every single-command could be directly mapped to a key without this addon...)
I will add this to the next version... (if you agree Wink)

Your welcome and of course I agree. Glad to be of some help


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - vazexa - 2013-03-16

Hello,
This is an excellent addon!!

How will it be possible to add a specific command i.e. Rip CD or Shutdown as a favorite, in order to add it directly to the Main menu??


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - AddonScriptorDE - 2013-03-21

(2013-03-16, 22:21)vazexa Wrote: How will it be possible to add a specific command i.e. Rip CD or Shutdown as a favorite, in order to add it directly to the Main menu??
These are all default xbmc commands (full list of all commands), you can add them to your favourites.xml like this:
Code:
<favourite name="Rip Audio CD">RipCD</favourite>



RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - SpiderDice - 2013-03-25

After I install this add on, and try to Launch it, the script fails. Anyone else getting this error?


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - AddonScriptorDE - 2013-03-29

(2013-03-25, 07:48)SpiderDice Wrote: After I install this add on, and try to Launch it, the script fails. Anyone else getting this error?
Hard to say if someone is getting your error! Because you didn't posted it... Wink
Please upload your log file so i can have a look at it...


RE: [RELEASE] Commands - Map multiple xbmc commands to one remote button - SpiderDice - 2013-03-29

Log Uploader installed fine, but never sent me the e-mail, and that script failed too. Haha

I grabbed my xbmc.log file, removed all the passwords, and then tried to upload it to xbmclogs.com Apparently, 1.6MB is too big for the server to handle.


TL;DR
Here's my log file:
http://ge.tt/8M3HfRc