Smart Rules: if-this-then-that for Mac power and cooling
Most keep-awake decisions are not one-time switches. You want the Mac awake while a build is actually running, asleep once it is idle, and you want it to back off when the battery is low or the chassis is warming up. Smart Rules let you describe those conditions once and let LidRun act on them, using its own levers rather than promising things macOS will not allow.
Why a single keep-awake switch is not enough
A manual toggle has exactly two states, and your day has more than two. The same Mac that should stay wide awake during a 40-minute cargo build should probably be allowed to sleep an hour later when nothing is running and the battery is at 18 percent.
If you leave keep-awake on permanently to cover the busy moments, you also keep the machine awake through all the idle ones. That is wasted battery, and on a warm desk it is wasted heat. Flip it off and you are back to babysitting, toggling it the moment a long job starts.
Smart Rules are the in-between. You write the condition, LidRun watches for it, and the action fires when the condition is true. It is the difference between holding a button down and setting a thermostat.
The conditions you can react to
A rule starts with a condition. LidRun can match on a process whose name fits a pattern you set (so a rule can key off Docker, Ollama, an Xcode build, or a python script), on battery being below or above a percent, on temperature staying above a number of degrees for a duration, on whether you are on battery or on AC power, on the lid being closed, on no matching workload having run for N seconds, and on a time window.
The duration and holdoff parts matter more than they look. A momentary temperature spike during a build is normal; a rule that triggers only after the reading stays above your threshold for a while avoids reacting to noise. Likewise, "no matching workload for N seconds" is what lets a rule decide a job is genuinely done rather than just pausing between steps.
Temperature here comes from the SMC sensor keys LidRun reads directly. Because no single key exists on every Mac, it tries a list of candidates and takes the hottest valid reading, so the number a rule compares against is the warmest part it can see, not a guess.
Guía relacionadaThe safety governor: why LidRun won't keep a hot or idle Mac awakeWhat a rule is allowed to do
Actions revolve around LidRun's own controls, and that limit is deliberate. A rule can keep the Mac awake, allow it to sleep, switch to a cooling profile within what the hardware allows, or send you an alert. It does not pretend to do things macOS will not let an app do.
That is worth being honest about. Fan write-control is largely restricted on Apple Silicon by firmware and SIP, so a cooling profile leans on what the hardware exposes; LidRun reads temperatures and works within those limits rather than promising a manual fan curve on M-series. A rule that says "cool down" is not a magic override.
The payoff is that every action a rule can take is one LidRun can actually carry out, recorded in the Activity Log so you can see what fired and why.
Rules a developer would actually set
Stay awake while it works: if a process matching "ollama" is running, keep the Mac awake. When no matching workload has run for, say, 120 seconds, allow sleep. That covers an overnight model pull without leaving the machine awake the rest of the night.
Back off when it gets warm: if temperature stays above your threshold for a couple of minutes, switch to a cooling profile and send an alert. You get a heads-up and a response that stays within the hardware's limits, instead of finding out later from a hot chassis.
Protect the battery off mains: if you are on battery and charge drops below the percent you set, allow sleep even if a watched job is still running. Pair it with a time-window rule, like "only keep awake between 9pm and 7am," and an unattended overnight run stops cleanly instead of running the cell flat. Airflow and where you put the Mac are still on you; a rule reacts to numbers, it cannot improve a closed bag.
LidRun mantiene tu trabajo en marcha con la tapa cerrada, con protección de batería y temperatura integrada.
Preguntas frecuentes
A matching process running, battery below or above a percent, temperature above a number of degrees for a duration, on battery or on AC power, the lid being closed, no matching workload for N seconds, and a time window. You can combine these to describe a real situation.
No. Rule actions are LidRun's own levers: keep awake, allow sleep, switch a cooling profile within what the hardware allows, or send an alert. Fan write-control is largely restricted on Apple Silicon, so a cooling profile works within those limits and does not promise a manual fan curve.
It can. A rule can allow the Mac to sleep when charge drops below the threshold you set, and the safety governor already gates keep-awake on battery, thermal state, and unattended timeouts underneath your rules.
Use the "no matching workload for N seconds" condition. It waits for the process to be gone for the duration you set before acting, so a brief pause between steps does not trigger it prematurely.