v0.3.0: lid-closed mode is a button
Lid-closed mode used to mean typing a sudo command. In 0.3.0 it is a control in Preferences,
backed by a privileged helper that macOS installs and that you can take back off from the same
window.
Lid-closed mode
coffee-bar can now register a small root helper through SMAppService. The XPC channel between
the app and that helper is pinned in both directions by Team ID and bundle ID, so each end refuses
to talk to anything else.
macOS shows no prompt for a daemon registration. The first time you arm it, approval is a switch
you turn on in System Settings, General, Login Items and Extensions, and then you arm again. There
is still no password, ever.
Removing the helper releases the sleep hold before it unregisters, in that order, so the machine
cannot be left held awake by a helper that is no longer there. macOS keeps the app's entry in Login
Items and Extensions after removal, because the helper's plist ships inside the bundle.
Arming puts the display to sleep immediately. That is deliberate: it is what makes the machine
ready for the lid to close.
An unsigned local build cannot register a helper, so it does not offer to. It names the sudo
command instead. A Homebrew install is ad-hoc signed and takes that same path.
Also in this release
- A quick start the first time the window opens, covering agent tools, the battery floor and the
display hold. - coffee-bar can open at login. Ticking it writes one file to your home folder and nothing else.
- A check for updates. It asks this project's site which version is current, at most once a day
when coffee-bar starts, and whenever you press Check now. It carries no identifier, downloads no
update, and never replaces coffee-bar. The privacy page says exactly what the request contains. - An agent can read coffee-bar's own state over the same unix socket it already posts hook events
to. - The lid-closed hold is a setting rather than a fixed 30 minutes. On battery it still ends at the
battery floor. - Keeping the Mac awake now also keeps it answering, so an agent is not awake and unreachable.
Install
The disk image on this page is the signed artifact: Developer ID, notarised by Apple, and stapled,
so it opens on a machine that has never been online.
A Homebrew or source build is ad-hoc signed. Gatekeeper does not accept it, and it cannot use the
privileged helper. That is not a fallback path, it is a different one, and it is documented.
Requirements
- macOS 14.0 or later.
- Apple silicon only.
lipo -archsreportsarm64. This is not a universal binary and an Intel
Mac cannot run it.
Verifying the download
shasum -a 256 coffee-bar-0.3.0.dmg
# 61009669234d891418bfd367289a95cb7fed85ab407711ba1038bbdde3fc441d
spctl --assess --type open --context context:primary-signature -vv coffee-bar-0.3.0.dmg
# accepted
# source=Notarized Developer ID
Size: 1054199 bytes.