Profiles Switcher › Automations › Stays awake at your desk
Keep your Mac awake while it is docked
Create a Docked profile that requires an external display and the charger, and add a Prevent sleep action. Your Mac stays awake at the desk and sleeps normally again as soon as you undock.
- When
- External displayOn the charger
- Then
- Keep display awakeSound to the monitor
Last updated
How to set it up
- Create a Docked profile. Add a profile named Docked and set the match to "All are true".
- Add the rules. Add an Any external display rule and an AC power (charger) rule set to "On AC power".
- Add Prevent sleep. Add Prevent sleep and choose "Keep display awake" for a screen you are looking at, or "Keep system awake" for downloads and backups where the screen may turn off.
- Undock to test. Unplug the display: the profile stops matching and the Mac goes back to its normal sleep settings.
Get Profiles Switcher on the Mac App Store, for macOS 13 or later
A setting that should depend on where the Mac is
System Settings can stop your Mac from sleeping on the power adapter, but that is one global switch. At the desk you want the screen to stay on while you read or watch a dashboard; in a bag you want the laptop to sleep the moment you close it. Flipping the switch by hand, or running caffeinate in Terminal and forgetting it, is how batteries end up flat.
The Docked profile ties “stay awake” to the desk itself: an external display plus the charger. Undock and the profile stops matching, the assertion is released, and the Mac sleeps normally again.
Why both rules, with “All are true”
- External display alone would also match at a hotel TV or a presentation on battery.
- Charger alone would also match on the sofa while charging.
- Both together is a reliable description of your desk.
If you have one specific monitor at home, use a Named display rule instead of Any external display, so only that desk keeps the Mac awake.
Make the desk profile complete
Docking is also when you want the sound on the monitor’s speakers, your work apps open and maybe the keyboard layout of your external keyboard. Put those actions in the same profile and docking sets up the whole desk. Add a low-priority Everyday profile to put the sound back on the laptop speakers when you undock.
Frequently asked questions
Is this the same as caffeinate?
It uses the same macOS mechanism, a power assertion, but it switches on and off by itself with your desk setup, so you never forget to stop it.
Will the Mac stay awake with the lid closed?
Prevent sleep blocks idle sleep. A closed laptop stays awake only in clamshell mode, with an external display and a charger connected, which is exactly the setup this profile is for.
What is the difference between the two options?
"Keep display awake" keeps the screen on, so the whole Mac stays awake. "Keep system awake" lets the screen turn off but keeps the Mac running underneath.
Related automations
Set it up in a few minutes
Profiles Switcher is a menu bar app for Mac (macOS 13 or later, Apple Silicon and Intel) that switches your Mac's setup automatically. You build profiles from 19 triggers, such as the Wi-Fi network you join, a place, headphones or a display, and 18 actions, including running any of your Shortcuts. Everything runs on your Mac; it is available on the Mac App Store.
Download on the Mac App Store