How to execute a linux command by pressing a remote key?

My kodi sometimes freezes and I have to ssh into CoreELEC and execute systemctl restart kodi to fix it, Is it possible to execute this command by pressing a key on my remote ? If so then please provide a tutorial for it. I’ve tried keymap editor addon and I’ve mapped Restart Kodi to a key but it doesn’t work when I press it while the kodi freezes

Which IR are you using?
meson-ir or amremote

Solved with System.Exec(exec)

1 Like

So Kodi can restart itself even if it freezes? Interesting.

As long as coreelec doesn’t freeze, I also ended up creating advancedsettings.xml and edit some parameters, it looks like it has solved the whole freezing thing

If you don’t have an extra button on your remote to use you can use if you have android phone to send ssh cmds to your box

I use my Google Home to restart kodi or reboot the box using this -

Somehow being able to simply ask for a restart/reboot takes some of the sting out it freezing in the first place.

1 Like

For posterity sake, it certainly would be nice if you could share here your settings with some instructions on how to do it.

Thanks I’ll check that out

Create a file advancedsetttings.xml and put it under /storage/.kodi/userdata/:


That’s the content of my file, or you can try every setting in this link

1 Like

Sadly I don’t have google home

Thank you.