KeyRoutines
TriggerFreetrigger.power.sleep

Run a routine when your PC goes to sleep on Windows 11

Going to sleep starts a routine as the PC is going to sleep or hibernating. It's for quick last-moment tidy-ups, like pausing media so it doesn't resume at full volume.

How it works

  • It has no settings and fires whenever the PC starts to sleep or hibernate.
  • Windows only gives a brief moment before sleeping, so keep the steps short and quick.
  • On a Modern Standby PC, going to sleep is the screen turning off, because that's how Windows sleeps there.

Routines that use it

Pause before sleeping

Media control pauses whatever is playing so it doesn't blast out on wake.

Mute for the morning

Mute or unmute mutes the speakers so the PC wakes quietly.

Remember what you were doing

Set variable records the time, and a Woke up routine later says how long the PC slept.

Good to know

  • There's only a moment before sleep: long or slow steps may not finish.

Questions

Can I run something just before my PC sleeps?
Yes, with the Going to sleep trigger. Keep it to a few quick steps, because Windows doesn't wait long.
Why does it fire when my screen turns off?
On Modern Standby PCs, Windows treats the screen going off as going to sleep, so the trigger follows that.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.