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

richard371

macrumors 68040
Original poster
Feb 1, 2008
3,741
1,926
I currently have my MBP M1 connected via the USB-C input on my LG 27" 4K monitor and I frequently switch to HDMI connection for my work Win machine. Every time I switch back to the Mac its asleep when the display is closed. I have it set to "prevent computer from sleeping when display is off."
 

jdb8167

macrumors 601
Nov 17, 2008
4,859
4,599
There is an undocumented setting in the command line pmset command that might solve your problem. I haven't tried your exact problem but I use it all the time to keep a M1 MacBook Air in clamshell mode without a power adapter connected from going to sleep.

disable sleep on
sudo pmset -b disablesleep 1

disable sleep off
sudo pmset -b disablesleep 0

Enter your admin password at the prompt(s).
 

richard371

macrumors 68040
Original poster
Feb 1, 2008
3,741
1,926
Thanks. I may try it but I do want it to sleep when its closed and not plugged into the cable. maybe I can't have it both ways. Workaround is to keep it open a bit when swapping back and forth.
 

jdb8167

macrumors 601
Nov 17, 2008
4,859
4,599
Thanks. I may try it but I do want it to sleep when its closed and not plugged into the cable. maybe I can't have it both ways. Workaround is to keep it open a bit when swapping back and forth.
I either turn off the setting or use the sleep menu item in the apple menu. I think if you don't have a bluetooth or wired keyboard it will still go to sleep when you close the lid but I'm not positive.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.