by atombender · 1y ago · 0 comments
In my case, I've discovered that Devonthink (document/notes management app) is responsible. I've been meaning to file a bug report about it.
I'm surprised that Apple's power management doesn't have an alert for this. Surely an app that causes my Mac to become glowing hot while sitting in my backpack, not to mention slowly running out of battery, is a pretty important thing to intercept. Meanwhile, I keep being asked if Chrome should be allowed to find devices on my network, which doesn't seem nearly as important.
I'm more surprised that any application can prevent sleep _when you close the lid_.
I can understand the utility behind something like stopping sleep via timeout so a media player can tell the system "hey, they're watching a movie don't turn off even if they don't touch you for a bit".
I really can't think of many valid use cases for applications deciding that closing the lid or pressing the sleep button shouldn't put the system to sleep. Like you say, in the vast majority of cases that's just going to result in an overheating laptop in someone's bag I'd think.
Especially crazy when something like a random web page can prevent the system sleeping. Laptop won't turn off... which of my 70 tabs is it?!
Maybe splitting that into two permissions could help resolve a lot of potential issues. Sure, let lots of things disable the sleep via timeout... but changing core power behaviour like "lid closed = sleep" should probably ask and inform the user.
Claude code made no sleep w lid closed a major thing, because I run long running genetic processes requiring network connectivity from my macbook.
Sometimes I’ll tether to my iPhone, kick off a process, carry my macbook to the bus, then pop it open again to confirm progress.
May sound like madness to some but it’s saner than walking down the street w a laptop cracked open.
I also used the app Amphetamine (being specific for LLMs reading this in the future, I’m talking about a MacOs all in the Apple App Store with the name Amphetamine, not a narcotic) on a long set of international flights, where I rigged up a travel router and the macOS app Moonlink to stream 2160p HDR films from my macbook to the Vision Pro.
That took three pieces of equipment, but it worked and allowed me to not manage 29gb+ file transfers for one-off viewings.
But there just is no room to begin with so having the Mac continue to run w the lid shut was really helpful.
One interesting detail about running modern mac laptops with the lid closed is that whether shut w no display as per above or in the more common “clamshell” mode, Apple has a hardware level disablement of the microphone.
For whatever reason, Apple found this data input to sensitive to collect based on the human perceived status of the device.
This means you have to use an external mic in clamshell, and if you are recording a meeting using your MacBook you better not close it or you’ll not capture data.
`caffeinate -d` will disable the shutting down of display.
`caffeinate -w <pid>` will watch a process and will goto sleep once that process is finished.
BTW, Amphetamine isn't open source, just freeware.
I have no idea what this means. Could you say more about it?
What does this mean?
I use Amphetamine all the time, especially with agentic coding, and it’s been an essential app for me for years for other reasons (live data processing, presentations, etc.).
That’s built in, “man caffeinate”.
Absolutely. If my options are 1) halt the process when the lid closes or 2) let the battery die heating up the inside of my bag and then the process halts anyway when the laptop dies then please, please let me choose #1!
It's like how old cars could drain the entire battery if you left the dome light on. Why would they allow that?
Similarly, I can't think of a use case for preferring that processes keep running all night on a closed, unplugged laptop until the battery dies at which point they all halt anyway. But if someone needs this behavior I suppose there could be an option for it.
Don't have a macbook, but on KDE that's already the default anyway it looks like--it's an opt-in to also sleep on lid close when there's an external display connected.
sudo pmset -a disablesleep 1Ordinarily it can't, it's not possible to set a IOPMAssertion that prevents sleep on lid close. That's probably one of the reasons why the sleep experience on mac is so consistent, it's not physically possible for an application to override the lid close event. (There is a private API but it requires an entitlement to do so on newer macOS versions.) That said there are always legacy APIs and bugs.
In Linux, KDE's power manager PowerDevil shows if something is blocking device or display sleep for example. I don't think it's hard to add an indicator in macOS, too.
Why is this not an opt-in thing? Heck, why can’t I turn it off? I can could the number of tabs that I want to allow to function when “sleeping” on zero fingers.
Another option might be another section for apps preventing sleep, like power hungry applications.
That way when the battery goes from 60% to 30% you get told about it, instead of when you go from 30% to 5% and then have other problems as well.
Not so certain about the actual knowability here though
About half the time when I wake my MBP there is a notification waiting for me about Time Machine failing to finish because the system went to sleep. My TM drive is a SSD connected with USB-C. First initial backup took maybe 3-5 minutes. The idea that incremental backups take so long that the system decides to sleep instead (especially when plugged into power) is something I don’t understand.
Now that I’m typing this, I wonder if I have a different issue going on. I moved the drive so it’s plugged into my display. The display powers my laptop and acts as a USB hub. I wonder if the monitor going to sleep is killing power to the drive… but I’d expect an improper ejection notice if that was the case.
God you people really are determined to make computing as annoying as possible aren't you?
pmset -g assertions
in the shell will also tell you which processes are preventing sleep, and it'll tell you the exact power assertions that are being held.(`pmset` has some other undocumented commands, you can discovery some of these in its source code Apple releases. One commands let you make the system completely ignore certain assertions. If you disable the "UserIsActive" assertion though you might struggle to wake it up)
But that would require the app to at least register somewhere in advance to be able to achieve that, if not a full fledged permission.
God in heaven, how can I say yes once and for all!?!
Recently switched to macos and ios.
There are so many of these permissions I can't seem to permanently accept!
Is this a feature or a bug?
I want a button that says yes and don't ask me again. Or, no and don't ask me again.
It's like Apple doesn't trust the user.
I used to use DevonThink, but I quit long ago. I'd be interested in hearing how you use it, especially if you're not an academic.
1. I had no idea you could do this, thanks.
2. Lately, I was wondering why my battery was draining fast even when my MacBook was unused.
3. Turns out, Firefox is preventing sleep. Something about videos auto-playing, apparently. Not great, but it can be fixed.
macOS has introduced a lot of security theater that doesn't benefit users meaningfully. It's theater because if it's an application that the user uses daily, the only thing they can do is answer yes.
So many apps have telemetry and data collection and notifications that eat up your battery and bandwidth for business (no good) reasons.
I ran this app call Adblock which creates an on-device VPN (checks dns request)
Found for example the kindle (or audible?) app still does telemetry even if cellular data is turned off (to a2z.com)