0

I have an HTPC and it needs to be suspended with the convenience of using the physical power button on the casing, Even when the screen lock appears on the display! After leaving the Ubuntu 18.04 system idle for a while,as per the configured settings, it activates the screen lock. After doing so, the single press of the physical power button on the computer does not suspend it anymore. I would have really wanted to work. If i unlock the screen, and subsequently press the power button, the suspend works. Can anyone help to overcome the behavior where the power button does not work when the lock is active?

1

I found a superuser answer that applies to your situation:

Someone pointed me to the file /etc/systemd/logind.conf. I was able to set parms that allowed the suspend key to work in any situation regardless what the system requests. Here is an example of my settings.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=lock
#PowerKeyIgnoreInhibited=no
SuspendKeyIgnoreInhibited=yes
#HibernateKeyIgnoreInhibited=no
LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min

For some reason a restart was not applying the changes, so I had to run the following command:

sudo systemctl restart systemd-logind
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.