My question is how do I get my laptop (Thinkpad t470) to reliably lock and sleep when closing the lid?
The original problem I was having is when I closed the laptop at the lock screen it simple wouldn't sleep, just turn off the screen. The suspend/lock when lid is shut (power manager settings) only worked when logged in to the computer, otherwise trying to suspend from the lock screen by closing the lid would only result in a request to authenticate in order to suspend as soon as I logged back in--my battery went from full to dead overnight which is how I realized this was happening.
While trying to troubleshoot this issue I found a post that recommended editing the
/etc/systemd/logind.conffile to get the laptop to suspend as desired, even at the lock screen. Editing that file as follows:
HandleLidSwitch=suspend. This seemed to partially fix the original problem, but brought with it a new issue I believe.
This is where I'm at so far: I've tried adjusting the power manager to suspend when lid is closed both when plugged in and on battery, and lock the system when going to sleep. The current behavior I'm getting is when I close the lid it locks and sleeps like I want. The problem arises when I open it back up--it wakes up for about 5 seconds, everything freezes for a second and it goes back to sleep. To wake it back up I have to either close it again and reopen it or press the power button to bring it out of sleep and from there it stays awake like it should.
-The logind.conf file stated to delete it to revert to the default settings which I did but the problem persists (and now I don't have a logind.conf file if that matters). Does anyone know what might be causing this? Thanks.