Skip to content

Suppress screen lock during meetings (lock-guard) - #25

Merged
twistedmelonman merged 10 commits into
mainfrom
claude/feat-lock-guard-meeting-suppression
Aug 12, 2026
Merged

twistedmelonman merged 10 commits into
mainfrom
claude/feat-lock-guard-meeting-suppression

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

Summary

  • Adds bin/lock-guard, a new client-side script invoked over SSH by lock-fanout (replacing a bare pmset displaysleepnow) that skips the lock and logs why if the client looks like it's in a meeting: a known process running (Zoom/Teams/FaceTime, configurable via ~/.config/lock-sync/guard-processes), the microphone actively in use (pmset -g assertions), or an active Google Meet room tab open in Chrome (osascript, 3s timeout).
  • Every check fails open on error (never blocks a legitimate lock indefinitely).
  • Wires lock-guard into bin/install/bin/uninstall and documents the new config file and one-time Chrome Automation permission grant in CLAUDE.md/README.md.

Notable fixes from review

A local final whole-branch review caught two real bugs verified live on hardware before merge:

  • SSH PATH: lock-fanout was invoking lock-guard by bare name, but non-interactive SSH sessions don't have ~/.local/bin on PATH — every remote call failed with ssh_exit=127. Fixed to invoke via an absolute, remotely-expanded path.
  • Mic detection dead on Apple Silicon: the original ioreg -c IOAudioEngine approach returns zero output on Apple Silicon Macs (legacy Intel/kext-era IOKit class). Replaced with pmset -g assertions, verified against a real mic open/close on this hardware.

Also hardened: Meet-URL regex host anchoring (was matching unrelated hosts as a substring), config file trailing-whitespace/CRLF handling.

Known non-blocking follow-up (filed separately): docs/plans/2026-08-12-lock-guard-meeting-suppression-design.md's Task 1 code block still describes the abandoned ioreg approach rather than the shipped pmset one — the design doc's rationale section wasn't updated when the implementation pivoted. Code and tests are correct and consistent with each other.

Test plan

  • bats tests/ — 53/53 passing
  • shellcheck -S info bin/* — clean
  • Verified live on asiago (the Synergy server/controller for this repo's author): ran bin/install, confirmed lock-guard symlinked, triggered a real screen lock, confirmed ssh_exit=0 for asiago itself in ~/Library/Logs/lock-sync.log
  • Other Synergy clients (arich-mac, mimolette, tilsit) need bin/install re-run on each after this merges — documented in CLAUDE.md's new "Upgrade path" note

https://claude.ai/code/session_01Sasr2N9Rj9n8rv2sjwN2YJ

Claude Code Bot added 10 commits August 12, 2026 12:17
…tion, Meet URL anchoring, config whitespace)

- lock-fanout: invoke lock-guard via $HOME/.local/bin/lock-guard (escaped
  for remote expansion) instead of a bare name, since ~/.local/bin is not
  on the non-interactive SSH PATH.
- lock-guard: replace ioreg-based mic detection (dead code on Apple
  Silicon) with pmset -g assertions / coreaudiod PreventUserIdleSleep.
- lock-guard: anchor the Meet URL regex to https://meet.google.com/ to
  avoid matching unrelated hosts/substrings.
- lock-guard: trim trailing whitespace/CRLF in guard-processes config
  lines so they match pgrep -x correctly.
- CLAUDE.md: document that upgrading requires re-running bin/install on
  every Synergy client, not just the primary machine.
@claude

claude Bot commented Aug 12, 2026

Copy link
Copy Markdown

The diff introduces bin/lock-guard (meeting-detection gate for pmset displaysleepnow), wires it into lock-fanout, and updates install/uninstall/tests accordingly.

No BLOCK-worthy issues found. A few things I traced to confirm they are safe:

  • set -euo pipefail + functions that return 1: all three check_* calls in main are used as if conditions, which are excluded from set -e abort semantics — no silent exit.
  • The mic-active check uses pmset -g assertions | grep -qi coreaudiod.*preventuseridlesleep (not ioreg as the design doc says); the code comment explains the intentional change, and the tests are consistent with the implementation.
  • The Meet-tab regex requires the https:// prefix, so the evil.com-as-referer test case holds.
  • Remote command "\$HOME/.local/bin/lock-guard" is correctly escaped so $HOME expands on the remote shell rather than locally.

VERDICT: PASS

@twistedmelonman
twistedmelonman merged commit 7bfddfa into main Aug 12, 2026
4 of 5 checks passed
@twistedmelonman
twistedmelonman deleted the claude/feat-lock-guard-meeting-suppression branch August 12, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant