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.

  • juipeltje@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    23 hours ago

    Depends a bit on your setup. If you’re using systemd you can use the logind.conf as already mentioned, or if you’re on a non-systemd distro you can use the forked elogind, which works pretty much the same way. For locking your session when suspending, since i use wayland, i use swayidle for that. In its config i just put before-sleep 'swaylock', which will execute swaylock before the system goes to sleep.