Suspend kodi directly by press of power button (chassis , not remote)
#1
I found a million instructions on how-to and finally managed to make kodi suspend immediately (that is without popping up and stepping through the shutdown menu) after I pressed the power button on my remote.

However, I'd like to have the same behavior when pressing the power button on my PC/chassis. Currently it only makes the shutdown menu appear, which is not very handy when you don't have your remote at reach. I didn't find any guidance on how to achieve this and assume it is probably a bit more komplex than just editing a keymap.xml file.

My system is running Ubuntu desktop 16.04. LTS. Any hints are welcome.
Reply
#2
I did some thing similar a little while ago


You need to edit the /etc/systemd/logind.conf
Find HandlePowerKey and uncomment it, then change the command to suspend, so it looks like HandlePowerKey=suspend

You will also need to edit /etc/acpi/events/powerbtn if it exists and comment out all the commands in there.

the system should now suspend when you press the case button
Reply
#3
@Bagger: Thanks, that was exactly what I was looking for. In fact, I only edited /etc/acpi/events/powerbtn and set action=xbmc-send --action="suspend"

Edit: Which (my way) I found didn't work as expected. It shuts the system down, though I thought it was suspended.

What I'd like to do as an improvement is to invoke a script which checks if the system is really idle (no ongoing recordings or pvr clients connected) before suspending as I do when the remote's power button is pressed.

Since the script is executed from outside kodi I'd probably need to alter the script or find out how the action command in powerbtn is actually processed to adapt it appropriately
Reply

Logout Mark Read Team Forum Stats Members Help
Suspend kodi directly by press of power button (chassis , not remote)0