Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

PauliusOr

macrumors newbie
Original poster
Sep 12, 2022
9
1
Hi, is there a way to prevent new MacBook Air M2 from sleep when lid is closed? I tried plenty of 3rd party apps which I successfully used previously on older MacBook Air (Amphetamine, No Sleep etc.) but nothing works.

I have a suspicion that Apple has changed something mechanically that makes the Mac no longer work with the lid closed (except with an external monitor connected). I have not found any useful information on the Internet.
 
Did you check “Prevent your Mac from automatically sleeping when the display is off”? I think if you’re connected to a external display it should still stay on with that checked
 
Did you check “Prevent your Mac from automatically sleeping when the display is off”? I think if you’re connected to a external display it should still stay on with that checked
Yes, I did, but the point is that this setting is related to power adapter. In my case there is a need to prevent sleep with closed lid whether using a battery or a charger.
 
if you want to stay awake with an external display without being plugged in to a charger you need to run:

sudo pmset disablesleep 1

Replace the “1” with a “0” to go back to normal.
 
  • Like
Reactions: PauliusOr
if you want to stay awake with an external display without being plugged in to a charger you need to run:

sudo pmset disablesleep 1

Replace the “1” with a “0” to go back to normal.
Thanks for command, I tried it before and it's working. But I'm still looking for "one-click" options (like Amphetamine, NoSleep etc.) as with M1/Intel Macs.
 
I have a shortcut that calls the command line with sudo. It only works though because I also added sudo to use the Touch ID. There might be some way to tell shortcuts to authenticate the command line.

Edit:

This works.

Run Applescript on run{input parameters} do shell script "pmset disablesleep 1" with administrator privileges end run
 
Last edited:
In case anyone needs it, app called "One Switch" lets disable sleep when lid is closed on MacBooks with M2.
 
In case anyone needs it, app called "One Switch" lets disable sleep when lid is closed on MacBooks with M2.
I know this is an old thread, but Google brought me here as I was looking for a simple 'quick toggle' app that would disable sleep when the lid is closed, but I don't think One Switch is working for me. It looks like my M2 Air is still sleeping when closing the lid. Does this app work for you?

I use Amphetamine, but the option to disable sleep while lid is closed is disabled on my M2 Airs, so I was hoping that this app would do the trick. It's shocking to me that Apple doesn't allow a user to simply 'Prevent the computer from sleeping when the lid is closed'. Used to be such a basic 'feature'. Not sure if this limitation is Ventura thing.
 
Last edited:
I know this is an old thread, but Google brought me here as I was looking for a simple 'quick toggle' app that would disable sleep when the lid is closed, but I don't think One Switch is working for me. It looks like my M2 Air is still sleeping when closing the lid. Does this app work for you?

I use Amphetamine, but the option to disable sleep while lid is closed is disabled on my M2 Airs, so I was hoping that this app would do the trick. It's shocking to me that Apple doesn't allow a user to simply 'Prevent the computer from sleeping when the lid is closed'. Used to be such a basic 'feature'. Not sure if this limitation is Ventura thing.
Hm, strange. I'm still using One Switch (version 1.29) and it works fine for me. I suggest you test this app by running some longer process and closing the screen.

I have no doubt that there are already other alternatives to One Switch that work with M2 processors, but since it works fine for me, I'm not looking for additional problems.

We'll find out if this is the limit of Ventura in the autumn with the next macOS release. However, my wife's MacBook Air with M1 is identical to my M2, so I guess the new Apple processors are to blame here.
 
  • Like
Reactions: Sowelu
Hm, strange. I'm still using One Switch (version 1.29) and it works fine for me. I suggest you test this app by running some longer process and closing the screen.

I have no doubt that there are already other alternatives to One Switch that work with M2 processors, but since it works fine for me, I'm not looking for additional problems.

We'll find out if this is the limit of Ventura in the autumn with the next macOS release. However, my wife's MacBook Air with M1 is identical to my M2, so I guess the new Apple processors are to blame here.
Yeah, it's odd. After activating this option in One Switch, my M2 15" Air still goes to sleep. If I close the lid for a few seconds to test, as soon as I open it again I have to authenticate with TouchID (which is fine) but then I notice that my Remote Desktop Connection into my company's system was disconnected. I also tested playing a YouTube video and sure enough, that cuts out as soon as I close the lid.

This feature is also available with the Amphetamine app on my M1 MacBook Air, and it works as it should, but this option is disabled in the app on my M2 15" Air which makes me think it may be a 15" Air thing. I have to try both apps on my 13" M2 Air at some point today.
 
Hm, strange. I'm still using One Switch (version 1.29) and it works fine for me. I suggest you test this app by running some longer process and closing the screen.

I have no doubt that there are already other alternatives to One Switch that work with M2 processors, but since it works fine for me, I'm not looking for additional problems.

We'll find out if this is the limit of Ventura in the autumn with the next macOS release. However, my wife's MacBook Air with M1 is identical to my M2, so I guess the new Apple processors are to blame here.
Have been in touch with the developer of One Switch - he updated it and now it works on my 15" MacBook Air. It finally stays awake with the lid closed. It's a great app - one click access to many frequently used options. Bought a few licenses for my MacBooks. Thanks again for the tip.
 
  • Like
Reactions: PauliusOr
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.