Skip to content

Clamshell 0.3.0

Pre-release
Pre-release

Choose a tag to compare

@Bagilov Bagilov released this 28 Oct 19:47
· 5 commits to main since this release

Blank the built-in panel when the lid closes, and align a session across restarts.

Added

  • clamshell reconcile re-aligns a pending session after a restart: a trigger still in the future is re-armed with the remaining time, and one that already passed restores sleep instead of leaving it disabled forever. The menu bar app runs it at launch.
  • clamshell status --json and clamshell battery --json emit machine-readable state. The menu bar app reads the JSON form, falling back to the text parser for an older CLI.
  • clamshell darken blanks the display on demand, so the menu bar toggle also applies to a session that is already running.
  • The menu bar app remembers the chosen battery floor, duration, custom span and display toggle across launches.
  • clamshell on now always starts the session watcher, including for an unlimited session with no time limit and no battery floor.

Fixed

  • The built-in display is now blanked when the lid closes. With sleep disabled macOS does not do this on its own: the idle display timer normally handles it, and on battery that timer is off, so a shut lid could leave the panel lit. The session watcher blanks it again on every pass, and skips that when an external display is attached or any probe fails.
  • clamshell off restores sleep before cancelling the timer, so a cancellation cannot leave sleep disabled with no trigger and no state file.
  • The watcher retries a failed restore, logs to ~/Library/Logs/clamshell.log, and keeps the state file so a refused sudo cannot let the battery drain unnoticed.
  • A duration longer than 30 days is rejected by the CLI, matching the limit the menu bar app already enforced.
  • The menu bar no longer crashes when the status menu is rebuilt while it is still installed.
  • The menu checks the duration that is actually running, and nothing is checked when a custom span is in use.
  • A command that times out keeps the child's stderr in the error message, truncated so a runaway log cannot bloat the alert.
  • The menu bar no longer hangs for the full command timeout when the CLI writes more than the ~64 KiB pipe buffer.
  • A CLI error is now shown in front of the active app, and the countdown keeps ticking while the menu is open.
  • clamshell status reports a reached battery floor even when a time limit is also active.
  • The helper rotates its log through a mktemp file and keeps logging when a rotation step fails.
  • The version test compares both Info.plist keys through plistlib, so a bundle whose version strings drifted apart is caught.
  • package.sh fails with a clear message when the version cannot be read and ships only the known modules.

Documentation

  • README states the current version, documents the helper log and state-file paths, and no longer implies the helper copy under ~/Library/Application Support/clamshell/ is what runs as root.

Notes

  • Requires macOS 14 or newer on Apple Silicon.
  • The app is an accessory (LSUIElement): a moon glyph in the menu bar, no Dock icon.
  • Clamshell-0.3.0.pkg (sha256 38d8cee712165b5c347736c5d145b1634b3f4e6e24e1314e07061499701a863a) installs the CLI, the root-owned helper with its narrow sudoers rule, and the menu bar app.

See CHANGELOG.md for details.