> And that’s not all. I close my laptop lid when my laptop is docked. Windows helpfully sleeps the laptop even though external monitors, a mouse, and a keyboard are connected. There is no fix.
Right click the battery icon in the system tray > Power Options > Choose what closing the lid does > Do nothing.
Of course, then lid close will never work as intended. What I want is for lid close to sleep IFF no external monitors are connected, regardless of whether the machine is on AC power or not. Thank you for the suggestion, and in my actual solution, I basically programmatically switch this setting on and off based on whether or not external monitors are connected.
This is what Windows Custom Power Plans was built for. Have a plan called "Docked" that disables lid close, and leave it as sleep in other plans. Custom Power Plans have been buried in Windows 10 as confusing power user/OEM features, yet they still exist.
I think there's an option in settings to select the primary display - if you set that to the external display, theoretically it should work. My laptop stops sleeping on lid close with this.
What the hell. It’s one thing to say you prefer nothing to happen on lid close. That’s cool. I don’t want that. This is like saying, “I would like a mocha” and having the barista say “Wrong, you want an iced coffee.” No, I do want my laptop to sleep on lid close, just not when it’s docked. This is clearly not much to ask for considering Linux and macOS do it just fine by default and I can still disable sleep on lid close if I want to.
Why is it better for Windows to do this wrong? It is clearly a side effect of the fact that the Power Policy system only differentiates between AC and DC and no other conditions.
What happens when I move rooms? Well, I only have one docking setup. But also, it is not a problem if my laptop spuriously goes to sleep. (My solution does not automatically sleep the laptop when it is undocked, either, so this is also still not an issue.)
It came out harsh, sorry. But it is more like asking for a 33cl beverage but getting 35cl.
There are tons of issues with a computer spuriously going to sleep. Network connectivity dies for one, as well as lots of minor quirks such as music stops etc. Having control of that is quite essential.
Being forced to manually sleep despite ones preferences is not a major issue. It is a sub-second operation that comes with lots of benefits. One of which being explicit with what you want to do.
On the flip side, a laptop failing to go to sleep can be a fire hazard or at least permanently damage your laptop, depending on where it’s stored. This killed one of my X1 carbons.
And yet, my Ubuntu does the right thing in both cases:
- When the lid is closed and there are no external monitors, the laptop goes to sleep.
- When there is an external monitor, it switches to it entirely.
And when the external is disconnected after that (the laptop is still closed), it goes to sleep fine.
Right click the battery icon in the system tray > Power Options > Choose what closing the lid does > Do nothing.