Kodi Community Forum

Full Version: script.skinshortcuts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm not sure of the best way to contact a mod to get the first post updated, but if you (or anyone else) has suggestions for what should be in the first post - aside from a link to git and the docs - I'll see what can be done.
script.skinshortcuts

Image

About:
Skin Shortcuts is a script used by skins to manage user shortcuts, including main menus, sub menus and custom widgets.

Features:
  • Unlimited menu items
  • Create shortcuts to almost anything - library, add-ons, favourites, sources, UPnP and more
  • Rearrange, add and delete shortcuts as you want
  • Override actions
  • Create shortcuts directly to a node provided by an add-on
  • Create shortcuts to only show library content from a particular source
  • Choose backgrounds and widgets for each of your menu items
  • Keep your customised menu if you switch to another skin using the script

Download:
Available In Official Kodi Repository.

GitHub repository:
https://github.com/BigNoid/script.skinshortcuts

Wiki Page:
http://kodi.wiki/view/Add-on:Skin_Shortcuts

Getting Help:
If you are having difficulty using Skin Shortcuts, your first port of call should be the forum or the thread of the skin you are using. People there can normally offer hints and tips in using the script, and can direct you where to go for more help if needed.
If you are getting a script error, then you should seek help in the development thread for the script, linked at the top of the page. Remember to include a debug log.
Hey Bob,
do you mind to take a look here: http://pastebin.com/M6ctH9B6
line 226.
this is a completly fresh install, I just install Kodi 16, and then my skin from the official repo. I checked in the log and saw this errors.

Thank you.
First off, a huge thanks to Hitcher for updating the first post of the thread, and a ginormous one for tomer953 for suggesting it needed updated and what should go there.

The error your seeing is handled. It just means that the skins .hash file (used by the script primarily to determine whether the menu needs to be rebuilt) can't be loaded which, on a new installation, it of course can't as it doesn't exist yet. The fact that it hasn't been able to be loaded will automatically trigger a menu build. Unless you're actually having issues - such as the menu not being built - the error can be safely ignored.

Note to self:- one day, I really must get around to handling that error better Smile
a huge thanks to Hitcher and even not a small one for me? Wink heh

and thanks for your quick reply! if it safe, then all good.
Edited Wink
(2016-02-08, 23:40)BobCratchett Wrote: [ -> ]Edited Wink

LOL. much better.. actually I copy-pasted almost all the content from the wiki page here http://kodi.wiki/view/Add-on:Skin_Shortcuts so credit goes to the wiki page creator too Cool
Is it possible to show Addons related to a Menuitem?

The Idea would be to offer the User a option to set some main menu item related Addons ("Addonshortcuts") all within the shortcut script.
Wondering if something would be possible?

(Underneath the Menu item "Radio" -> Addon "Radio.de" + Addon "Shoutcast2" for example.)

first i thought i could try to do it outside of script skinshortcuts via
Code:
Skin.SetAddon(HomeAddonButton1,xbmc.addon.video,xbmc.addon.audio,xbmc.addon.image,xbmc.addon.executable)
+ use stringcompare to a script given property. but im not verry happy with this solution. (the way i've tryd it, it is just usable with the default Menu items, and i didnd fine a workaround so far.)

The Idea would be to let the user choose main menu item related Addons, in a similar way like it is possible to choose submenuitems for a existing menu item. + then show it by contentpath in Home.

Is there currently a way to achieve what im after within the script?
Submenu items - I don't think so. The main menu/submenu is based around the idea of static items and from what I can see you'll need dynamic content for this.

A widget - it's possible, if you know of (or can get written) a plugin that can return the relevant addons, or you're happy with all audio plugins, all video plugins etc, or you know the necessary dynamic path that would show just the add-ons you're interested in.

Such a widget could be assigned automatically - to a new menu item, or one that doesn't have a widget already assigned - via a property fallback. Something of the order of (for a 'Pictures' menu item):-

Code:
<propertyfallback group="mainmenu" property="widgetPath" attribute="path" value="ActiveWindow(Pictures,return)">[the path of the widget provider to use]</propertyfallback>

You'd likely want to set the other widget properties too, though. This will also only work with the latest git (hopefully heading to the repo soon). Overall, though, it's not a very clean solution.
(2016-02-10, 01:27)BobCratchett Wrote: [ -> ]Submenu items
(2016-02-10, 01:27)BobCratchett Wrote: [ -> ]A widget - it's possible, if you ..., or you're happy with all audio plugins, all video plugins etc, or ...
(I would like to choose from a list off Addons, and show the chosen in the Homescreen. (per menuitem). )

--

Tanks

Jer, did (already) think of both (2nd submenu and 2nd Widget).
Was hoping i miss some functionalyty. (overrides.xml for example)

--

2nd submenu was the closest i can get.

if it would be possible to do "submenu groupings" i could do what im after. Did think of something like this:

Code:
<submenu-1-groupings>
        
    <node label="32010">
        <content>addon-video</content>
    </node>
    <node label="32011">
        <content>addon-audio</content>
    </node>
    <node label="32012">
        <content>addon-image</content>
    </node>
    <node label="32009">
        <content>addon-program-plugin</content>
    </node>
        
</submenu-1-groupings>

that would be cool.
You mean to limit what is available to select with the 'Choose Shortcut' and 'Change Action' button? That's doable via custom groupings. If you just want one grouping for all submenu's, check !StringCompare(Window.Property(groupname),mainmenu), SetProperty(custom-grouping,submenu-1) and SendClick(401)/SendClick(307) (you'll want to do it for both buttons Wink)

You could probably get more creative if you wanted different custom groupings depending on the action of the main menu item. Add <onclick>SetProperty(skinshortcuts-management-path),$INFO[Container(211).ListItem.Property(path)],10000)</onclick> to 406 (and clear it on unload) and you could check against that for setting the custom-grouping property.
(2016-02-10, 19:25)BobCratchett Wrote: [ -> ]You mean to limit what is available to select with the 'Choose Shortcut' and 'Change Action' button?
Exactly

(2016-02-10, 19:25)BobCratchett Wrote: [ -> ]check !StringCompare(Window.Property(groupname),mainmenu), SetProperty(custom-grouping,submenu-1) and ..
Huh ?


Code:
<!-- Choose Addons in Home -->
<control type="button" id="406">
    <width>1200</width>                
    <label>Choose Addons in Home</label>
    <onclick>SendClick(401)</onclick>
    <onclick>SendClick(307)</onclick>
        <visible>StringCompare(Window.Property(groupname),mainmenu)</visible>
</control>


overrides.xml -> as posted aboth


EDIT:
not possible to Enter the shortcut Window if i try to do it like this:

Code:
<!-- Choose Addons in Home -->
<control type="button" id="406">
    <width>1200</width>                
    <label>Choose Addons in Home</label>
    <onclick>SendClick(401)</onclick>
    <onclick>SendClick(307)</onclick>
    <onfocus>SetProperty(custom-grouping,submenu-1)</onfocus>
    <onunfocus>ClearProperty(custom-grouping)</onunfocus>
    <visible>StringCompare(Window.Property(groupname),mainmenu)</visible>
</control>
First, move your controls 401 and 307 somewhere out of the way and make them invisible. You'll be sending clicks to them so they still need to be in the window, but the user won't interact with them directly. In place of 401:-

Code:
<control type="button" id="8000">
    <width>1200</width>                
    <label>Choose Addons in Home</label>
    <onclick condition="!StringCompare(Window.Property(groupname),mainmenu)">SetProperty(custom-grouping,submenu-1)</onclick>
    <onclick>SendClick(401)</onclick>
</control>

And the same for 307, obviously with a different ID and SendClick to 307. (You can use any arbitrary ID as long as its not one of Skin Shortcuts, and isn't already in use in the window).

Now, when you click on your replacement buttons they should* show the groupings as normal for the main menu, and show your custom groupings in the submenu.

* I'm typing this blind, so obviously double-check I haven't made any howlers and, if its not working, enable Kodi + the scripts debug logging option and see what it says Wink
(2016-02-10, 20:13)BobCratchett Wrote: [ -> ]First, move your controls 401 and 307 somewhere out of the way and make ...
Sounds funny Smile

did work.

tnkx.
Hello,
The following will describe a problem I'm having with kodi.
With any skin and addons on Win10 I can not create categories of addons example widget: Action Movies, Drama, Comedy.

All this happens only with Win10 instead of Android and Mac does everything correctly.
below you will find links to videos on Mac and Windows, and log (Win10) to kodi.

If I'm not mistaken the problem would be this

PHP Code:
12:05:34 T:2360   ERRORXFILE::CDirectory::GetDirectory Error getting
12
:06:48 T:5408   ERROREXCEPTIONNon-Existent Control 111
12
:06:48 T:5408   ERROREXCEPTIONNon-Existent Control 306
12
:06:48 T:5408   ERROREXCEPTIONNon-Existent Control 308
12
:06:48 T:5408   ERROREXCEPTIONNon-Existent Control 309
12
:06:48 T:876   ERRORTraceback (most recent call last):
12:06:48 T:876   ERROR:   File "C:\Users\america\AppData\Roaming\Kodi\addons\script.skinshortcuts\resources\lib\nodefunctions.py"line 86in parse_view
12
:06:48 T:876   ERROR:     tree xmltree.parsefile )
12:06:48 T:876   ERROR:   File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py"line 1182in parse
12
:06:48 T:876   ERROR:     tree.parse(sourceparser)
12:06:48 T:876   ERROR:   File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py"line 657in parse
12
:06:48 T:876   ERROR:     self._root parser.close()
12:06:48 T:876   ERROR:   File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py"line 1654in close
12
:06:48 T:876   ERROR:     self._raiseerror(v)
12:06:48 T:876   ERROR:   File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py"line 1506in _raiseerror
12
:06:48 T:876   ERROR:     raise err
12
:06:48 T:876   ERRORParseErrorno element foundline 1column 0
12
:06:48 T:876   ERRORTraceback (most recent call last):
12:06:48 T:876   ERROR:   File "C:\Users\america\AppData\Roaming\Kodi\addons\script.skinshortcuts\resources\lib\nodefunctions.py"line 86in parse_view
12
:06:48 T:876   ERROR:     tree xmltree.parsefile )
12:06:48 T:876   ERROR:   File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py"line 1182in parse
12
:06:48 T:876   ERROR:     tree.parse(sourceparser)
12:06:48 T:876   ERROR:   File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py"line 657in parse
12
:06:48 T:876   ERROR:     self._root parser.close()
12:06:48 T:876   ERROR:   File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py"line 1654in close
12
:06:48 T:876   ERROR:     self._raiseerror(v)
12:06:48 T:876   ERROR:   File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py"line 1506in _raiseerror
12
:06:48 T:876   ERROR:     raise err
12
:06:48 T:876   ERRORParseErrorno element foundline 1column 0
12
:07:04 T:5408   ERRORJSONRPCFailed to parse '{ "jsonrpc": "2.0", "id": 0, "method": "Files.GetDirectory", "params": { "properties": ["title", "file", "thumbnail", "episode", "showtitle", "season", "album", "artist", "imdbnumber", "firstaired", "mpaa", "trailer", "studio", "art"], "directory": "plugin://plugin.video.streamondemand/?fanart=C:\Users\american\AppData\Roaming\Kodi\addons\plugin.video.streamondemand\fanart.jpg&channel=cineblog01&action=menugeneros&category=cineblog01&title=%5BCOLOR+azure%5DPer+Genere%5B%2FCOLOR%5D&fulltitle=%5BCOLOR+azure%5DPer+Genere%5B%2FCOLOR%5D&url=http%3A%2F%2Fwww.cb01.co&thumbnail=http%3A%2F%2Fxbmc-repo-ackbarr.googlecode.com%2Fsvn%2Ftrunk%2Fdev%2Fskin.cirrus%2520extended%2520v2%2Fextras%2Fmoviegenres%2FAll%2520Movies%2520by%2520Genre.png&plot=&extradata=&Serie=&show=", "media": "files" } }' 

Video
Android e Mac
Windows 10

Kodi.log

Thanks