Focus Mode Wallpaper

AppleScript utility for changing Mac wallpapers based on active Focus Mode.

Overview

Focus Mode Wallpaper is a small AppleScript utility that changes desktop wallpaper on macOS based on the active Focus Mode. It is designed to be triggered by Apple Shortcuts when a focus change is detected.

The script reads the focus mode name as input, maps that to image files in a local folder, and applies wallpapers across all desktops. For selected modes, it also hides desktop widgets to reduce visual noise.

Why I Built It

On iPhone, focus modes can be paired with distinct wallpapers. That same behavior is not built into macOS in a simple, direct way.

I wanted that same contextual shift on desktop: when I switch modes, the visual environment should switch too. So I built a lightweight script that can be called from Shortcuts and run locally.

This gave me a practical way to make focus changes feel more intentional without adding a heavy app or external dependency.

How It Works

The script expects a wallpaper directory at:

  • ~/Pictures/Wallpaper/Automated/

It receives the focus mode name as input and then applies one of two strategies:

  • Dynamic HEIC mode: if the mode contains Travel, it loads a single .heic file (for example Travel.heic) and applies it to all desktops.
  • Static JPEG mode: for other modes, it looks for monitor-specific files using the pattern ModeName-1.jpeg, ModeName-2.jpeg, and so on.

Additional behavior:

  • validates file paths before setting wallpapers
  • refreshes Dock after wallpaper changes for stability
  • toggles desktop widgets off for selected modes (currently Keynote and Prayer)

Why It Was Interesting

A tool like this is not going to change the world. But I find that anything that can help me context-switch between the different 'modes' of my work/life (e.g. work, home, travel, keynote, prayer) is worthwhile. Just looking at the wallpaper can be a reminder of where I am and what I am focused on.

I liked the combination of technical constraints and environment design. The script had to deal with dynamic wallpaper formats, multiple desktops, and macOS quirks, but the goal was human: making context switches easier.

It also reinforced a pattern I value: if a platform behavior almost exists but not quite, a small utility can close the gap.

Technical Notes

  • Language: AppleScript
  • Trigger model: Apple Shortcut passing current Focus Mode name
  • File strategy: dynamic .heic for Travel, monitor-specific .jpeg for other modes
  • Scope: local automation script with minimal dependencies

Links

Looking Back

This project is intentionally small, but it is the kind of automation that meaningfully changes day-to-day experience.

It solves a narrow problem cleanly: make focus changes visible, immediate, and repeatable on macOS. Until this behavior is native in the OS, this script does the job well.

Back to Desk