custom power button function

  • Hi, I'm using LE box as home server, some file sharing, I also use HTSP client on my mobile to watch live tv from DVB-T tuner attached, so basically I don't want LE box to be turned off at all.

    I wonder if there is some way to assign custom script or function to power button. only thing it should do is stop all playback and turn hdmi output off (alternatively turn on black screen screensaver). on another power button push it should resume the playback (preferably TV stream as when you turn on the kodi from suspend).

    at the moment I stop playback and turn off TV, and then girlfriend complains that in the morning she first turn it off and then she has to turn it on. for me it would be also more convenient.