tally

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 9 Imported by: 0

README

Tally

A macOS menu bar app that turns on a smart light outside your office when your camera is in use, so the household knows you're in a meeting. Named for the tally light — the red lamp on a studio camera that tells everyone it's live.

  • An ON AIR sign lives in your menu bar — lit red when you're live, dark when you're not
  • When any app (Zoom, Google Meet, FaceTime, ...) turns on your camera, your light turns red; when the camera turns off, the light turns off
  • Click the sign to override the status — Force On Air or Force Off Air for 5 minutes, 1 hour, or until you turn it off
  • Pick which light this computer controls from the same menu (scans your network for bulbs)
  • Optional Start at Login

Built with menuet.

How it works

Camera detection uses CoreMediaIO's kCMIODevicePropertyDeviceIsRunningSomewhere property, which reports whether any process has a capture device open — no log parsing, no per-app integration, and it doesn't require camera permission. Change notifications come from CMIO property listeners, with a low-frequency poll as a safety net.

Wiz bulbs are controlled over their local UDP protocol (JSON on port 38899, no hub, no cloud, no auth). Bulbs are discovered with a broadcast probe and identified by MAC address, so the app finds the bulb again if DHCP hands it a new IP.

While you're in a meeting the app re-asserts the red state once a minute, so the light recovers from power blips. When you're not in a meeting it leaves the bulb alone (after turning it off once), so the bulb can still be used as a normal light.

Building

Requires macOS and Go.

make run

builds Tally.app and launches it. go run . also works for quick iteration, but Start at Login wants a real bundle path, so prefer the app bundle for daily use.

Adding other brands of light

pkg/light defines the provider interface:

type Provider interface {
    Name() string
    Discover(ctx context.Context) ([]light.Config, error)
    Connect(cfg light.Config) (light.Light, error)
}

pkg/light/wiz is the reference implementation. A new brand (LIFX is the next obvious one — it has a similar local UDP protocol) just implements Provider, calls light.Register in its init, and gets a blank import in main.go; discovered lights from every provider show up together in the menu. Light identity (Config.ID) should be something stable like a MAC address, not an IP.

A future idea is to associate the selected light with the current Wi-Fi network, so a laptop can control different lights at home and at the office. Config is persisted as JSON with that kind of extension in mind.

Documentation

Overview

Tally is a macOS menu bar app that turns on a smart light outside your office when your camera is in use, so the household knows you're on the air. The menu bar shows an ON AIR sign — lit red when live, dark when not; click it to override the status or pick which light to control.

Directories

Path Synopsis
pkg
camera
Package camera reports whether any camera on this Mac is in use by any application, using CoreMediaIO's DeviceIsRunningSomewhere property.
Package camera reports whether any camera on this Mac is in use by any application, using CoreMediaIO's DeviceIsRunningSomewhere property.
light
Package light defines a provider-agnostic interface for network status lights, so tally can drive bulbs from different vendors (Wiz, LIFX, ...) through one API.
Package light defines a provider-agnostic interface for network status lights, so tally can drive bulbs from different vendors (Wiz, LIFX, ...) through one API.
light/wiz
Package wiz controls Philips Wiz smart bulbs over their local UDP protocol (JSON on port 38899, no auth, no hub).
Package wiz controls Philips Wiz smart bulbs over their local UDP protocol (JSON on port 38899, no auth, no hub).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL