That's what 99% of all laptop users would like a laptop be able to do, no? At the very least auto-suspend on close.
That's the main reason I can't even be bothered to configure this (as in from the GUI) on my Linux machines.
My use case is in direct contrast to the 99%, and with Linux being focused on a technical audience, it gets short shrift in terms of priorities/ resources.
(honestly, most of my computers are generally set to no automatic sleeping/ suspension)
Even now, turning off or disconnecting my Bluetooth headphones causes my modern/up-to-date Linux machines to reawake if they were connected before sleep, which inevitably causes my monitors to come back online and fill my room with light and fan noise while I'm trying to put _myself_ to sleep...
I have a habit now of just running:
systemctl suspend -i
Before closing the lid. Wake ups always work. That will suspend even if some applications is blocking suspends.Right? It's like, trying to suffocate itself. I just turn the damned thing off before going home now.
If I get it right, it's saying that Linux is intentionally bad at shutdown / hibernation because that's how its users want it. And users want it because they are better users than other users: they are "professionals", whose computers never sleep.
So, if you are using an OS that actually works as expected, that's just proof that you're an amateur.
(and let's ignore the mention of the lid being closed. Because that would be devastating to this argument)
At no point did I say users want it to be bad at shutdown/hibernation.
I said for my job/use-case, I spend most of my time trying to stop the computer from sleeping. I posted this because the comment I was responding to said that 99% of users wanted the computer to sleep on lid-shut, and I thought I'd contribute to point out that's the opposite of my use case (indeed, I pretty much want the computer to never sleep on lid-shut). And i run linux as the primary OS on pretty much all my computers. A lot of linux users are also probably coming from a background where computers didn't sleep/shutdown very often.
I didn't use the word amateur. I didn't use the word professional. I didn't mention anything about using an OS that works as expected. I listed my background and use case.
I didn't say anything about any users being better than others.
I do think, based on all that, you may have some sensitivities that made you interpret things in a particular light.
on lid close being the operative term here.
The first line seems to disagree that there's any issue, says it has been "flawless". Then goes on to list what I would certainly consider some very big flaws which can only be partially worked around with custom shell scripts and the like.
Suspend/resume to memory and to disk have been exceedingly reliable on every machine I've touched for a decade for me. On my old Dell convertible laptop, the wifi would only turn on every other time it woke up.
The machines waking up is a real problem. I have `HandleLidSwitch=ignore` in systemd's logind.conf[1]. I see there are other options though, which I might also try setting to ignore. I too sometimes have unexpected wakeups. I'd like to learn more about how to debug these. I've asked twice on IRC & gotten no reply. My backup plan has been to write a daemon to make the system go to sleep, and whenever it wakes up, put it back to sleep, unless I "disarm" the daemon. I'm in a fairly low-visibility environment now though- I feel like I should work the problem some, fix whatever is going wrong, rather than hack around, but I have not been successful at figuring out second steps in debugging systemd daemons, once `systemd status` & upping the logging level falls short.
I too have problems with some desktop things intercepting my power button, which again, I wish I had better visibility in to. I don't know other than trial & error to figure out who might be grabbing the input devices.
[1] https://www.freedesktop.org/software/systemd/man/logind.conf....
Kind of like cryonics then?
And people actually expect Linux to win over the desktop crowd when it can’t support even the most basic features consumers expect.
Now what is not flawless: There are any number of ACPI things that, if set, will immediately re-wake the computer once suspended. The following script is on my current problematic one as /usr/lib/systemd/system-sleep/wakefix.pl
#!/usr/bin/perl open(FILE,"/proc/acpi/wakeup"); while(<FILE>) { chomp; if(/enabled/) { ($a,$b) = split / /; system("echo $a >/proc/acpi/wakeup"); } }
[Sorry about the mangled formatting]
It just turns off everything that is enabled to wake the machine up. As this list happens not to include the power button - the only thing I want to be able to wake the laptop up - this works fine.
I've never experimented with auto-suspend on lid close and auto-resume on open; maybe that's what's more troublesome.
Another thing that's not suspend-resume, but nonetheless annoying - if the machine is running an SDL fullscreen thing (Tuxpaint) or if the MATE desktop has a pop-up menu open, the power button won't suspend the computer, because something intercepts the button press.
My experience with suspend/resume on Desktop machines has been 100% bad, on the other hand. Usually they suspend just fine, but don't resume to a usable state.