diff options
| author | Igor Soarez <igor@soarez.org> | 2026-11-01 10:22:01 +0200 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-11-01 10:22:01 +0200 |
| commit | 8146d1db419e8bdacd75920da6f3761abf724853 (patch) | |
| tree | 921a1d609d96bb2129f7ac2d80635fd3c0c41691 /menubar/main.swift | |
| parent | 959f0d46cac1a09d0821da599d8dff54d1147892 (diff) | |
show what pi agents cost today, this week and this month, counting forked replies once
Diffstat (limited to 'menubar/main.swift')
| -rw-r--r-- | menubar/main.swift | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/menubar/main.swift b/menubar/main.swift index 82931ab..77e2b5e 100644 --- a/menubar/main.swift +++ b/menubar/main.swift @@ -284,6 +284,14 @@ final class Menubar: NSObject, NSApplicationDelegate, NSMenuDelegate { menu.removeAllItems() rows = fetchRows() restoreOffer = fetchRestoreOffer() + let spend = fetchSpend() + if !spend.isEmpty { + let item = NSMenuItem(title: spend.line, action: nil, keyEquivalent: "") + item.isEnabled = false + item.toolTip = "What pi agents spent, closed ones included; days start at 00:00 UTC" + menu.addItem(item) + menu.addItem(.separator()) + } if let offer = restoreOffer { let item = NSMenuItem(title: restoring ? "Restoring tmux Sessions…" : "↺ \(offer.title)", action: nil, keyEquivalent: "") @@ -463,6 +471,8 @@ if arguments.contains("--selftest") { if arguments.contains("--print") { let rows = fetchRows() print("title: \(plainTitle(for: rows))") + let spend = fetchSpend() + if !spend.isEmpty { print("$ \(spend.line)") } let outdated = fetchOutdated() if !outdated.isEmpty { print("⟳ \(outdated.title)\t\(outdated.detail)\(outdated.canReload ? "" : "\t(disabled)")") |
