Linux is cool, I can do a lot of things with it. If i set a config file in Linux, I am damn sure that it is ran every single time. The code does what you tell it to do.
There is 1 thing that always seems to be “black magic”: 1) lid close and suspend 2) lid close and suspend and lock.
If we ignore locking for a moment and focus on suspend. I cant seem to figure out why sometimes lid close would suspend immediately, when other time it takes 5 seconds after lid closes. On some days, lid closes would not even suspend !!
Did anyone manage to get suspend work 100 %? I cant believe we have tons of great linux tools and years into kernel dev, and still suspend is a hit or miss.


Any normal desktop environment should lock, then suspend. KDE does that afaik, never had that issue.
So first lock, then suspend. As the process is ran by the system, it doesnt care if the screen is locked or not.