How to create a KODI entry to run a script?

Wrong place, keymappings go into userdata/keymaps/ see
https://kodi.wiki/view/Keymap#Defaults

Also very good to read for changing keymaps (even so title is for long press)

For changes to most files it is recommended to first stop Kodi and start afterwards.
sudo systemctl stop mediacenter
sudo systemctl start mediacenter

1 Like