---
title: "Shake It On"
url: https://deallocatedobjects.com/posts/shake-it-on
author: Jake Marsh
published: 2026-04-09
updated: 2026-04-09
topics: ["Things I Made", "Apple"]
description: "I made a little Mac app called Shake It On. It lives in your menu bar and keeps your Mac awake by giving the cursor a tiny, gentle shake every so often, the same way you’d nudge the mouse with your hand. That sounds like a solved problem, and in a lot of ways it is."
---

# Shake It On

By Jake Marsh, April 9, 2026. HTML: https://deallocatedobjects.com/posts/shake-it-on

I made a little Mac app called [Shake It On](https://shakeiton.app). It lives in your menu bar and keeps your Mac awake by giving the cursor a tiny, gentle shake every so often, the same way you'd nudge the mouse with your hand.

That sounds like a solved problem, and in a lot of ways it is. `caffeinate` exists, and there are good apps that tell macOS not to sleep. I kept running into cases where those weren't enough though, like a remote desktop session timing out in the middle of something, or a chat app flipping me to "away" while a long build ran. Those care whether *you* are there, and the way a Mac decides you're there is input, so Shake It On makes some.

### From Jiggler to Shake It On

It started life with the very literal working name "Jiggler," because that's what this kind of app is usually called: a mouse jiggler. I wanted something friendlier for an app that sits in your menu bar all day, and a verb you could say out loud. "Shake It On" describes what the app does.

### Real Input, Not a Sleep Assertion

The core trick is that Shake It On posts mouse events the way a physical mouse would. It creates its event source with `CGEventSource(stateID: .hidSystemState)` and posts at `.cghidEventTap`, which is the lowest point an app can inject events into the system. As far as macOS is concerned, that looks like someone moving the mouse.

That's why it keeps working in places where a "please don't sleep" assertion doesn't. If IT has locked the Energy Saver settings with a management profile, a system-level keep-awake setting can be overridden. Cursor movement is normal user input, so idle timers reset, remote sessions stay connected and presence indicators stay green. (Posting those events needs Accessibility permission, and the Settings window shows you where to grant it.)

The movement itself was the part I spent the most time on. Instead of jumping the cursor a few pixels and back, each shake traces a small, smooth, slightly random loop over about 400 milliseconds and lands exactly where it started, so it never moves your click target. I'm going to write that one up properly in its own post.

### Deciding When to Shake

The thing I wanted most from a jiggler, and couldn't find, was control over *when* it runs. Always-on is easy. "Keep my Mac awake while it's doing something I care about, and leave it alone otherwise" is the version I wanted, so the Settings window is mostly conditions.

![The Shake It On Settings window in dark mode, showing an Activation mode of Always active or Only when idle, an Only Shake If list (audio is playing, app is open matching, Wi-Fi is connected, external display connected, CPU is above threshold, external disk connected) and a Paused When list (display is off or locked, screensaver is running, Focus or Do Not Disturb is on, camera is in use, active app matching, on battery).](https://deallocatedobjects.com/media/posts/shake-it-on/settings.png "Most of Shake It On's Settings window is about when it should and shouldn't shake.")

The "Only Shake If" group is a list of things that have to be going on: audio is playing, a particular app is open, you're on Wi-Fi, an external display or disk is connected, or CPU is above a threshold you pick. Turn on any of them and at least one has to be true before it shakes. "Only while my render is pegging the CPU" and "only while my backup drive is plugged in" are each one toggle.

"Paused When" goes the other way. If the display is off or locked, the screensaver is running, Focus is on, the camera is in use, a certain app is in front, or you're on battery, it stops. And a schedule with a time range and days of the week means a work Mac can stay awake Monday through Friday, 9 to 5, and sleep normally the rest of the time.

On top of that there's a mode that only shakes after you've been idle for the interval, so it never moves the cursor while you're using it, and six interval presets from 5 seconds to an hour.

Most of these are cheap to check. A timer in the engine looks at the conditions every half second with a bit of tolerance so macOS can coalesce it, and anything that can be observed instead of polled is. "Audio is playing," for example, listens for Music's `com.apple.Music.playerInfo` distributed notification, so it costs nothing until the player state changes. The camera check asks AVFoundation whether any video device `isInUseByAnotherApplication`, which is a nice way to make sure the cursor never twitches during a video call.

### Living in the Menu Bar

It's a SwiftUI `MenuBarExtra` with no Dock icon. Open the menu and the first line tells you exactly what it's doing and why: "Active," "Waiting for idle," "Paused: on battery," "Paused: Xcode is active" and so on. Every condition in the engine sets that reason when it decides not to shake, which made the app much easier to trust (and to debug).

From the menu you can shake right now, snooze for 15 minutes up to 2 hours or a custom time, and get to Settings. There's a global keyboard shortcut to turn it on and off, an optional animated menu bar icon so you can tell at a glance when it's working, launch at login through `SMAppService`, and a few stats like shakes today and your longest session. Updates come through Sparkle.

### Getting It

Shake It On runs on macOS 14 and later, and you can get it at [shakeiton.app](https://shakeiton.app). It's a one-time purchase with free updates. If you've ever had a long download, a render or a remote session die because your Mac decided you'd wandered off, I think you'll like it.
