esc

Lock screen and menu bar

Two small places for something to glance at or act on: a pill under the clock while the Mac is locked, and rows in Ledge's menu bar panel.

A pill on the lock screen

5Under the clock, below the macOS timer, while the Mac is locked"lock-screen-row" · LedgeKit 0.11.0

A lock screen row is a symbol, a short label and a value to read at a glance. Ledge draws it in the same dark glass as the macOS timer's pill, and moves the lyrics down to make room.

AddOnSession.show(lockScreenRow: LockScreenRow(symbol: "timer", label: "Timer", value: "4:38"))
AddOnSession.show(lockScreenRow: nil)   // take it down
  • One per add-on, and up to two add-ons' pills at a time.
  • The label is up to 30 characters, the value up to 20.
  • Ledge shows it only while the Mac is locked, so you don't need to know when that is. Send it whenever it changes, and nil when there's nothing to show.
3The panel that opens from Ledge's menu bar icon, under Shelf, Clipboard and Settings"menu-bar-tile" · LedgeKit 0.11.0

A menu bar tile is a row in Ledge's style: a symbol, a title and a grey detail line. The panel grows to fit it.

AddOnSession.show(menuBarTiles: [
    MenuBarTile("toggle", symbol: "timer", title: "Start a timer", detail: "5 minutes")
])

handlers.onEvent = { event in
    if event.surface == Surface.menuBarTile, event.control == "toggle" { await countdown.toggle() }
}
  • Up to two tiles per add-on. The title is up to 40 characters, the detail up to 60.
  • A click sends .pressed with the tile's id. The panel stays open, so the row can change to show the result.
  • Update a tile by showing the list again, for example from “Start a timer” to “Timer · 4:38 left”.