Skip to content
KirkPXPublic

About

A brutally simple macOS menu bar app that keeps your MacBook awake with the lid shut.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Sidamo ☕

A brutally simple macOS menu bar app that keeps your MacBook awake with the lid shut — no external display required.

Named after the Ethiopian coffee region: it's the cup of coffee in your menu bar that keeps the machine up.

What it does

☕ Cup filled Lid-shut sleep disabled — close the lid, the Mac stays on
☕ Cup empty Normal sleep behavior

Click the cup to toggle. That's the whole app — one click on, one click off, and the cup tells you which you are.

Right-click for the menu: the same toggle, a Launch at Login checkbox, and Quit.

Under the hood, ON means:

  1. sudo pmset -a disablesleep 1 — macOS ignores the lid entirely
  2. An in-process PreventSystemSleep power assertion (the same one caffeinate -s holds) as belt-and-braces on AC power

OFF (and quitting the app) reverses both. Quit always restores normal sleep, so the laptop can never end up cooking in a bag because the app died with the toggle on.

Install

./scripts/build-app.sh
open ~/Applications/Sidamo.app

Requires Xcode Command Line Tools (xcode-select --install) and macOS 13+.

Note that build-app.sh replaces any existing ~/Applications/Sidamo.app and kills a running copy. To install on a different Mac without a toolchain, use install-remote.sh below instead — it leaves your local install alone.

Installing from a GitHub release

If you'd rather not build it, grab Sidamo-<version>.zip from the Releases page. It needs no Xcode tools. Apple Silicon only.

The app is ad-hoc signed and not notarized — this is a free personal project, and notarization needs a paid Apple Developer account. macOS will refuse to open it until you approve it once, by hand:

  1. Unzip it and drag Sidamo.app into /Applications (or ~/Applications).
  2. Double-click it. macOS blocks it: "Apple could not verify Sidamo is free of malware."
  3. Open System Settings → Privacy & Security, scroll to the bottom, and click Open Anyway beside the message about Sidamo.
  4. Confirm. It launches, and every launch after that is normal.

On macOS 13 and 14 you can instead right-click the app → Open → Open. That shortcut was removed in macOS 15 (Sequoia); there, use the Privacy & Security route above.

If you prefer the command line, this does the same thing in one step by stripping the download flag Gatekeeper keys off:

xattr -dr com.apple.quarantine /Applications/Sidamo.app

Only run that on software you actually trust. You can read every line of this one first — that's the point of it being here.

Cutting a release

./scripts/build-release.sh

Builds, ad-hoc signs, and packages build/Sidamo-<version>.zip for upload. Unlike build-app.sh it leaves your local ~/Applications copy alone. Bump CFBundleShortVersionString in Info.plist first — the zip is named from it.

Installing on a Mac with no toolchain

Sidamo is most useful on a Mac you keep shut and reach over ssh — which is exactly the Mac least likely to have Xcode Command Line Tools on it. You do not need them there. Nothing has to compile on the target machine.

Build here, ship the bundle across:

./scripts/install-remote.sh <ssh-host>

That builds, assembles and ad-hoc signs the app locally, then copies it to ~/Applications on the target over ssh. It refuses to ship a bundle the target cannot run: it compares CPU architecture (an arm64 build will not run on an Intel Mac) and the binary's minimum macOS version against the target before copying anything.

Two things make this work that are worth knowing:

  • scp does not set the com.apple.quarantine attribute. Gatekeeper blocks an ad-hoc signed app that arrived via a browser; the same bundle copied over ssh launches without complaint. If you ever move the bundle by some route that does quarantine it, clear it with xattr -dr com.apple.quarantine ~/Applications/Sidamo.app.
  • The architectures must match. Sidamo builds for the host architecture only, so build on a machine of the same kind as the target.

Installing the sudoers rule without the dialog

The first toggle normally shows the macOS administrator dialog to install /etc/sudoers.d/sidamo (see the next section). That dialog needs a real graphical session. Over ssh it cannot appear, and the failure is misleading — macOS reports:

first-run: install failed or cancelled:
  "The administrator user name or password was incorrect."

Nobody typed a wrong password. There was simply no GUI session to show the dialog in. The tell is the timing: the error comes back in about a tenth of a second, far quicker than anyone could type.

So on a headless or ssh-only machine, install the rule from a terminal instead. The binary will print the exact script the dialog would have run:

~/Applications/Sidamo.app/Contents/MacOS/Sidamo --sudoers-script | sudo sh

That prompts for your password once, then every toggle is silent — including over ssh. The script is generated by SudoersRule.installShellScript(for:), the same function the dialog uses, so the rule can never drift from what the toggle actually needs.

Inspect it first if you like — --sudoers-script on its own prints and changes nothing:

~/Applications/Sidamo.app/Contents/MacOS/Sidamo --sudoers-script

Clicking the cup once at the machine's own screen does the identical thing, if you have physical or Screen Sharing access.

How auth works (read this once)

Flipping disablesleep requires root. Instead of prompting for your password on every toggle, the first toggle shows the standard macOS administrator dialog once and installs a tightly-scoped rule at /etc/sudoers.d/sidamo:

you ALL=(root) NOPASSWD: /usr/bin/pmset -a disablesleep 1, /usr/bin/pmset -a disablesleep 0

Exactly those two commands become passwordless — nothing else gains any privilege. The rule is validated with visudo -c before being moved into place, and written via a temp name sudo ignores, so a half-written file can never be parsed.

Every toggle after that is instant and silent.

Uninstall

sudo pmset -a disablesleep 0        # restore normal sleep (the app does this on quit anyway)
sudo rm /etc/sudoers.d/sidamo       # remove the passwordless rule
rm -rf ~/Applications/Sidamo.app

CLI

The binary inside the bundle doubles as a command-line tool driving the exact same code path as the menu clicks:

~/Applications/Sidamo.app/Contents/MacOS/Sidamo --status          # "on" / "off"
~/Applications/Sidamo.app/Contents/MacOS/Sidamo --on
~/Applications/Sidamo.app/Contents/MacOS/Sidamo --off
~/Applications/Sidamo.app/Contents/MacOS/Sidamo --sudoers-script  # print, run nothing

--on and --off exit non-zero if the sudoers rule isn't installed yet, and --sudoers-script is how you install it where no dialog can appear — see "Installing the sudoers rule without the dialog" above.

This all works over ssh, which is the point:

ssh <host> '~/Applications/Sidamo.app/Contents/MacOS/Sidamo --on'

Testing

All logic lives in SidamoCore behind injectable seams (CommandRunning, PrivilegeEscalating), so the full toggle/first-run/failure matrix is unit tested without touching your system or showing dialogs:

swift test

Covers: pmset -g parsing (real captured output plus edge cases), the exact sudo/pmset invocations, the sudoers rule content and its validated atomic install script (including compiling the generated AppleScript), first-run install-then-retry, cancelled-auth handling, and every CLI exit path.

The GUI shell (Sources/Sidamo/main.swift) is deliberately too thin to hide bugs: menu clicks call the same tested PowerController methods the CLI uses.

Logs

Sidamo writes to the unified log (subsystem com.kirkpx.sidamo): every toggle, every pmset call and its exit status, first-run install attempts, external state changes it notices, and the restore-on-quit. Watch it work:

log stream --predicate 'subsystem == "com.kirkpx.sidamo"' --level debug   # live
log show --predicate 'subsystem == "com.kirkpx.sidamo"' --last 1h         # history

(--level debug also shows the 5-second state polls; drop it to see just the interesting events. Console.app works too — filter on the subsystem.)

Safety notes

  • Lid shut + no display = no airflow through the hinge gap. Don't run heavy workloads closed-and-covered, and never bag the machine while the cup is filled. Quitting Sidamo restores normal sleep as a backstop.
  • The icon re-reads real state from pmset -g (on click and every 5 s), so it stays honest even if you flip the setting from a terminal.

License

MIT

About

A brutally simple macOS menu bar app that keeps your MacBook awake with the lid shut.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages