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) https://kodi.wiki/view/Keymap

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 https://kodi.wiki/view/Advancedsettings.xml

If you don’t have an extra button on your remote to use you can use https://play.google.com/store/apps/details?id=com.pd7l.sshbutton&hl=en_US 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 - https://github.com/OmerTu/GoogleHomeKodi

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/:

<advancedsettings>
  <cache>
	<buffermode>1</buffermode>
	<memorysize>300000000</memorysize>
	<readfactor>90</readfactor>
  </cache>
</advancedsettings>

That’s the content of my file, or you can try every setting in this link https://kodi.wiki/view/HOW-TO:Modify_the_video_cache

1 Like

Sadly I don’t have google home

Thank you.