KeyRoutines
SystemWorks on Free

How to pause music when you walk away and resume when back

Use KeyRoutines' Idle trigger to pause with Media control when nobody has touched the PC for a while, and Remember a flag if music was playing. The Back at the PC trigger checks Remembered value is and plays again only if it paused it.

Steps

  1. 1

    Add both triggers

    Add Idle set to 10 minutes and Back at the PC set to after 10 minutes away.

  2. 2

    Going idle

    Add an If with Started by trigger set to Idle. Inside, if Media is playing, add Media control set to Pause and Remember pausedByMe as on.

  3. 3

    Coming back

    In the Else branch, add an If with Remembered value is pausedByMe on, then Media control set to Play and Remember pausedByMe as off.

Tips

  • Watching a video without touching the mouse counts as idle too; add an App or window in front check to skip your video player.

Questions

Does it use the microphone or camera to see me?
No. Idle only means no keyboard or mouse input.
Is it free?
Yes.

Blocks this routine uses

Trigger · SystemFree

Idle

Idle starts a routine after you've gone a set time without keyboard or mouse input. It's the trigger for "I've stepped away": lock, pause, save, or tidy.

Trigger · SystemFree

Back at the PC

Back at the PC starts a routine when you return after being away for at least the time you set. It's the welcome-back counterpart of the Idle trigger.

Condition · Flow and routinesFree

Started by trigger

Started by trigger checks which of a routine's own triggers began this run. That lets one routine react a little differently to a hotkey, a schedule or an app opening without keeping separate copies.

Condition · MediaFree

Media is playing

Media is playing is true while a player is actively playing. Check any player or one in particular, such as Spotify, so a routine can pause music only when there is music to pause.

Step · MediaFree

Media control

Media control sends play, pause, next, previous or stop to whatever is playing, or to a player you name. People use it to pause music for calls, resume it after games, and give keyboards without media keys a set of their own.

Step · Flow and routinesFree

Remember

Remember keeps a value safe after the routine ends, even across restarts of KeyRoutines and the PC. Use it for things like the last volume you set, a folder you picked, or whether you're away.

Condition · Flow and routinesFree

Remembered value is

Remembered value is reads a value saved by Remember or Toggle and answers a simple question about it. It's how a single hotkey knows whether to switch something on or put it back.

More how-to guides

Build this routine in KeyRoutines

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