Adding menu entry by OSMC source compilation


I am trying to add my own menu entry by compilation (not by gui).
So far, I have downloaded the OSMC sources and the filesystem tar. I added a copy the “My OSMC” entry in skin.osmc/16x9/script-skinshortcuts-static.xml file as the 15th (and last) entry and renamed it. I compiled the code, flashed it, and put it on a rbp3. I see my entry in the menu.
When leave the Runscript(service.osmc.settings)<\on click> the “My OSMC” menu opens. But when I redirect it to another location Runscript(/usr/shar/kodi/addons/<\on click> I keep seeing in the log:


16:56:42.953 T:1958539264 ERROR: ExecuteAsync - Not executing non-existing script /usr/share/kodi/addons/


In the I have an addon.xml file.
I am not sure where I can find information of how to initialize the labels of my entry in the script-skinshortcuts-static.xml file.

Can you please post the output of the following commands?

ls -lah /usr/share/kodi/addons/
cat /usr/share/kodi/addons/

Hi yknivag,

osmc@osmc:~$ ls -lah /usr/share/kodi/addons/
total 48K
drwxr-xr-x   3 root root 4.0K Jan  1  1970 .
drwxr-xr-x 159 root root  12K Jan  1  1970 ..
-rw-r--r--   1 root root  146 Dec 12 11:07 README
-rw-r--r--   1 root root  778 Dec 18 13:44 addon.xml
-rw-r--r--   1 root root    0 Dec 12 11:07 changelog.txt
-rw-r--r--   1 root root  650 Dec 12 11:07
drwxr-xr-x   5 root root 4.0K Jan  1  1970 resources
-rw-r--r--   1 root root 1.2K Dec 12 11:07
-rw-r--r--   1 root root  11K Dec 12 11:15 xxx_logo_3-300x76.png
osmc@osmc:~$ cat /usr/share/kodi/addons/
cat: /usr/share/kodi/addons/ Is a directory

It seems you are trying to execute a directory. But then that could just be a poor kodi error message.

There also seem to be problems with the permissions on that directory. Try setting the directory you created and all files in it as owned by the user osmc:

sudo chown -R osmc:osmc /usr/share/kodi/addons/

And it may not be a bad idea to set the executable bit on the python files:

chmod a+x /usr/share/kodi/addons/*.py

If I am not mistaken, this is how it’s supposed to be done. the directory should have an addon.xml file inside which will point to the python script.

Changing owner did not work. still see the same log.

I don’t think this is the issue since ls -al on service.osmc.settings shows the same permissions:

osmc@osmc:~$ ls -la /usr/share/kodi/addons/service.osmc.settings/
total 140
drwxr-xr-x   3 osmc osmc  4096 Jan  1  1970 .
drwxr-xr-x 159 root root 12288 Jan  1  1970 ..
-rw-r--r--   1 osmc osmc   146 Oct 24 13:42 README
-rw-r--r--   1 osmc osmc   865 Oct 24 13:42 addon.xml
-rw-r--r--   1 osmc osmc     0 Oct 24 13:42 changelog.txt
-rw-r--r--   1 osmc osmc   650 Oct 24 13:42
-rw-r--r--   1 osmc osmc 89468 Oct 24 13:42 fanart.jpg
-rw-r--r--   1 osmc osmc 14378 Oct 24 13:42 icon.png
drwxr-xr-x   5 osmc osmc  4096 Jan  1  1970 resources
-rw-r--r--   1 osmc osmc  1168 Oct 24 13:42

I think I am missing some type of registration of my addon somewhere…

This is more a Kodi issue than an OSMC specific one. Have you also tried asking there?

The error definitely suggests that kodi cannot see the file it wants to execute. Are you sure your addon.xml file contains the correct names for the python scripts?