Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

feat: Cicada stays in the Dock while it runs, with an orange dot while recording and a right-click menu

wquguru308f00c27dfe
diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings
index 435d594..3ec93c5 100644
--- a/Resources/en.lproj/Localizable.strings
+++ b/Resources/en.lproj/Localizable.strings
@@ -1375,3 +1375,7 @@
"去掉这些内容后就没有可分享的了。" = "Nothing would be left to share without these.";
"这场会议没有可分享的内容。" = "This meeting has nothing to share.";
"还有 %lld 处" = "And %lld more";
+
+/* Dock */
+"在 Dock 中显示" = "Show in Dock";
+"关掉后只在菜单栏,打开窗口时才出现" = "Off: menu bar only, in the Dock just while a window is open";
diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings
index b47147e..b77a69b 100644
--- a/Resources/ja.lproj/Localizable.strings
+++ b/Resources/ja.lproj/Localizable.strings
@@ -1375,3 +1375,7 @@
"去掉这些内容后就没有可分享的了。" = "これらを除くと共有できるものが残りません。";
"这场会议没有可分享的内容。" = "この会議には共有できる内容がありません。";
"还有 %lld 处" = "ほか %lld か所";
+
+/* Dock */
+"在 Dock 中显示" = "Dock に表示";
+"关掉后只在菜单栏,打开窗口时才出现" = "オフ:メニューバーのみ。ウインドウを開いている間だけ Dock に表示";
diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.strings
index cabe7eb..03d6908 100644
--- a/Resources/ko.lproj/Localizable.strings
+++ b/Resources/ko.lproj/Localizable.strings
@@ -1375,3 +1375,7 @@
"去掉这些内容后就没有可分享的了。" = "이 내용을 빼면 공유할 것이 남지 않습니다.";
"这场会议没有可分享的内容。" = "이 회의에는 공유할 내용이 없습니다.";
"还有 %lld 处" = "외 %lld곳";
+
+/* Dock */
+"在 Dock 中显示" = "Dock에 표시";
+"关掉后只在菜单栏,打开窗口时才出现" = "끄면 메뉴 막대에만 있고, 창을 열 때만 Dock에 나타납니다";
diff --git a/Sources/Cicada/AppMenu.swift b/Sources/Cicada/AppMenu.swift
index 2bd1fe7..82cd39f 100644
--- a/Sources/Cicada/AppMenu.swift
+++ b/Sources/Cicada/AppMenu.swift
@@ -118,6 +118,17 @@ final class AppMenu: NSObject, NSMenuItemValidation {
main.addItem(top)
}
+ /// Right-click on the Dock icon: the four things reached for most. Titles follow the meeting
+ /// through `validateMenuItem`, as in the menu bar.
+ func dockMenu() -> NSMenu {
+ let m = NSMenu()
+ m.addItem(item(L("停止记录"), #selector(toggleRecording)))
+ m.addItem(item(L("实时纪要"), #selector(openNotes)))
+ m.addItem(item(L("会议记录"), #selector(openRecords)))
+ m.addItem(item(L("设置…"), #selector(openSettings)))
+ return m
+ }
+
// MARK: State
func validateMenuItem(_ item: NSMenuItem) -> Bool {
diff --git a/Sources/Cicada/AppModel.swift b/Sources/Cicada/AppModel.swift
index b356c1d..0b8cffe 100644
--- a/Sources/Cicada/AppModel.swift
+++ b/Sources/Cicada/AppModel.swift
@@ -1998,6 +1998,11 @@ final class AppModel: ObservableObject {
let parts = arg.split(separator: ",").map(String.init)
Task { await notes.replay(parts[0], step: parts.count > 1 ? Int(parts[1]) ?? 4 : 4) }
case "notesShow": notes.show(arg)
+ case "dock": settings.showInDock = arg != "off" // 在 Dock 中显示
+ case "dockRender": // dockRender:<png>: the Dock tile as drawn now
+ guard let v = NSApp.dockTile.contentView, let rep = v.bitmapImageRepForCachingDisplay(in: v.bounds) else { debugFail("dock: no tile"); break }
+ v.cacheDisplay(in: v.bounds, to: rep)
+ try? rep.representation(using: .png, properties: [:])?.write(to: URL(fileURLWithPath: arg))
case "notesCapturable": notesWindow.setCapturable(arg != "off")
case "notesShare": setNotesCapturable(arg != "off") // the setting itself, as its badge or switch does
case "notesClose": notesWindow.performClose()
@@ -2278,13 +2283,14 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate, UNUs
private var settingsWindow: NSWindow?
private var pollTimer: Timer?
private var runningObserver: Any?
+ private var dockObserver: Any?
private var popoverClickMonitor: Any?
private lazy var menu = AppMenu(model: model)
/// Held here: a toolbar keeps only a weak reference to its delegate.
private lazy var mainToolbar = MainToolbar(model: model)
func applicationDidFinishLaunching(_ notification: Notification) {
- NSApp.setActivationPolicy(.accessory)
+ NSApp.setActivationPolicy(model.settings.showInDock ? .regular : .accessory)
menu.showMainWindow = { [weak self] in self?.showMainWindow() }
menu.showOnboarding = { [weak self] in self?.showOnboarding() }
menu.install()
@@ -2299,6 +2305,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate, UNUs
self?.statusItem.button?.image = BrandImage.menuBar(live: live, badge: badge)
self?.statusItem.button?.toolTip = problem ?? update.map { L("有新版本 \($0.version)") }
debugLog("menu bar: badge=\(badge) tooltip=\(problem ?? "-")")
+ DockIcon.show(live: live)
+ }
+ dockObserver = model.settings.$showInDock.dropFirst().sink { [weak self] _ in
+ // After the change lands: the observer fires before the property is set.
+ DispatchQueue.main.async { MainActor.assumeIsolated { self?.updateActivationPolicy() } }
}
let poll = Timer(timeInterval: 1.0, repeats: true) { [weak self] _ in
MainActor.assumeIsolated { self?.model.refreshPermissions() }
@@ -2372,6 +2383,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate, UNUs
return false
}
+ func applicationDockMenu(_ sender: NSApplication) -> NSMenu? { menu.dockMenu() }
+
/// Quitting ends the meeting being recorded: ask first.
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
guard !model.updates.installing, model.running, let id = model.store.liveID, !(model.store.session(id)?.lines.isEmpty ?? true) else { return .terminateNow }
@@ -2524,15 +2537,18 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate, UNUs
}
}
- /// A regular app (name and menus top left, Dock icon, ⌘Tab) while the main, settings or
- /// onboarding window is open; only the menu bar item otherwise. The notes window doesn't
- /// count: it floats beside the meeting app and never takes focus from it.
+ /// A regular app (name and menus top left, Dock icon, ⌘Tab) while 在 Dock 中显示 is on, or
+ /// else while the main, settings or onboarding window is open; only the menu bar item otherwise.
+ /// The notes window doesn't count: it floats beside the meeting app and never takes focus from
+ /// it (a regular app doesn't change that: the panel is non-activating either way).
func updateActivationPolicy(closing: NSWindow? = nil) {
let open = [mainWindow, onboardingWindow, settingsWindow].contains { $0 != nil && $0 != closing && $0!.isVisible }
- let policy: NSApplication.ActivationPolicy = open ? .regular : .accessory
+ let policy: NSApplication.ActivationPolicy = open || model.settings.showInDock ? .regular : .accessory
guard NSApp.activationPolicy() != policy else { return }
NSApp.setActivationPolicy(policy)
- debugLog("activation policy → \(open ? "regular" : "accessory")")
+ debugLog("activation policy → \(policy == .regular ? "regular" : "accessory")")
+ // Back from .accessory the Dock can show a blank icon until the tile is drawn again.
+ DockIcon.show(live: model.running)
}
// MARK: Output device changes
diff --git a/Sources/Cicada/DebugControl.swift b/Sources/Cicada/DebugControl.swift
index a446ca3..398e6b7 100644
--- a/Sources/Cicada/DebugControl.swift
+++ b/Sources/Cicada/DebugControl.swift
@@ -106,6 +106,7 @@ extension AppModel {
"overlay": ["shown": self.overlay.isShown, "expanded": self.overlay.expanded],
"keyWindow": NSApp.keyWindow?.title ?? "",
"onboardingStep": self.onboardingStep, "mainShow": self.mainShow ?? "",
+ "dock": ["shown": NSApp.activationPolicy() == .regular, "setting": self.settings.showInDock, "live": DockIcon.live],
] }
all["notes"] = { [
"state": "\(self.notes.state)", "topics": self.notes.notes.topics.count,
diff --git a/Sources/Cicada/DockIcon.swift b/Sources/Cicada/DockIcon.swift
new file mode 100644
index 0000000..102e9fa
--- /dev/null
+++ b/Sources/Cicada/DockIcon.swift
@@ -0,0 +1,38 @@
+import AppKit
+
+/// The Dock tile: the app icon, with an orange dot at the top right while a meeting is being
+/// recorded (the same "live" the menu bar icon shows).
+@MainActor
+enum DockIcon {
+ private(set) static var live = false
+
+ static func show(live: Bool) {
+ self.live = live
+ let tile = NSApp.dockTile
+ // Drawn ourselves either way: after the app turns regular again the Dock can otherwise keep
+ // a blank tile until something redraws it.
+ let view = NSImageView(frame: NSRect(origin: .zero, size: tile.size))
+ view.image = image(live: live)
+ view.imageScaling = .scaleProportionallyUpOrDown
+ tile.contentView = view
+ tile.display()
+ }
+
+ private static func image(live: Bool) -> NSImage {
+ let icon = NSWorkspace.shared.icon(forFile: Bundle.main.bundlePath)
+ let size = NSSize(width: 256, height: 256)
+ return NSImage(size: size, flipped: false) { rect in
+ icon.draw(in: rect)
+ guard live else { return true }
+ // Inside the icon's own rounded square (about 80% of the canvas, centered), top right.
+ let d = rect.width * 0.22
+ let dot = NSRect(x: rect.maxX - rect.width * 0.1 - d * 0.8, y: rect.maxY - rect.height * 0.1 - d * 0.8,
+ width: d, height: d)
+ NSColor.white.setFill()
+ NSBezierPath(ovalIn: dot.insetBy(dx: -d * 0.1, dy: -d * 0.1)).fill()
+ NSColor(srgbRed: 0.91, green: 0.33, blue: 0.17, alpha: 1).setFill()
+ NSBezierPath(ovalIn: dot).fill()
+ return true
+ }
+ }
+}
diff --git a/Sources/Cicada/Settings.swift b/Sources/Cicada/Settings.swift
index 359e45f..11a841f 100644
--- a/Sources/Cicada/Settings.swift
+++ b/Sources/Cicada/Settings.swift
@@ -170,6 +170,12 @@ final class AppSettings: ObservableObject {
/// The text model in use, for display.
var textModel: String { aiConfig.textModel }
+ /// Keep the icon in the Dock while Cicada runs. Off: menu bar only, the icon showing just while
+ /// the main, settings or onboarding window is open.
+ @Published var showInDock: Bool {
+ didSet { save() }
+ }
+
/// End the meeting when the meeting app it was heard through hangs up.
@Published var endWithApp: Bool {
didSet { save() }
@@ -264,6 +270,7 @@ final class AppSettings: ObservableObject {
displayMode = defaults.string(forKey: "displayMode") ?? "notes"
speakVoices = defaults.dictionary(forKey: "speakVoices") as? [String: String] ?? [:]
endWithApp = defaults.object(forKey: "endWithApp") as? Bool ?? true
+ showInDock = defaults.object(forKey: "showInDock") as? Bool ?? true
silenceEnd = defaults.string(forKey: "silenceEnd") ?? "prompt"
silenceMinutes = defaults.object(forKey: "silenceMinutes") as? Double ?? 10
listenSource = ["room", "both"].contains(defaults.string(forKey: "listenSource")) ? defaults.string(forKey: "listenSource")! : "system"
@@ -319,6 +326,7 @@ final class AppSettings: ObservableObject {
defaults.set(displayMode, forKey: "displayMode")
defaults.set(speakVoices, forKey: "speakVoices")
defaults.set(endWithApp, forKey: "endWithApp")
+ defaults.set(showInDock, forKey: "showInDock")
defaults.set(silenceEnd, forKey: "silenceEnd")
defaults.set(silenceMinutes, forKey: "silenceMinutes")
defaults.set(listenSource, forKey: "listenSource")
diff --git a/Sources/Cicada/UpdateViews.swift b/Sources/Cicada/UpdateViews.swift
index 10abd41..e8a090d 100644
--- a/Sources/Cicada/UpdateViews.swift
+++ b/Sources/Cicada/UpdateViews.swift
@@ -70,6 +70,10 @@ struct AppRows: View {
Toggle("登录时打开", isOn: Binding(get: { loginItem.enabled }, set: { loginItem.set($0) }))
.toggleStyle(.switch).labelsHidden().controlSize(.small).tint(Palette.ink)
}
+ SettingsRow(title: L("在 Dock 中显示"), detail: L("关掉后只在菜单栏,打开窗口时才出现")) {
+ Toggle("在 Dock 中显示", isOn: Binding(get: { model.settings.showInDock }, set: { model.settings.showInDock = $0 }))
+ .toggleStyle(.switch).labelsHidden().controlSize(.small).tint(Palette.ink)
+ }
SettingsRow(title: L("版本 \(Updates.current)"), detail: checkDetail) {
if updates.update != nil {
SoftButton(L("安装并重新打开"), dark: true) { updates.install(model: model) }
diff --git a/site/changelog.json b/site/changelog.json
index 4242b17..db187d9 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -1,4 +1,21 @@
[
+ {
+ "version": "1.7.0",
+ "date": null,
+ "title": "Dock 里找得到知了,分享一键复制",
+ "summary": "知了开着就在 Dock 里,录音时带橙点。",
+ "image": null,
+ "items": [
+ {
+ "kind": "new",
+ "platforms": [
+ "mac"
+ ],
+ "title": "开着就在 Dock 里,录音时图标带一个橙点。",
+ "text": "以前只有打开主窗口或设置时 Dock 里才有知了,开会时找不到它。现在知了开着就在 Dock 里,正在记录时图标右上角有个橙点;右键图标可以开始或停止记录、打开实时纪要、会议记录和设置。只想要菜单栏的话,在“设置 › 通用”里关掉“在 Dock 中显示”。"
+ }
+ ]
+ },
{
"version": "1.6.1",
"date": "2026-11-08",
diff --git a/tools/README.md b/tools/README.md
index fcabcbb..d81f9d2 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -33,6 +33,7 @@
- 声音:`voice:<语言>[=<id>]`、`voicePreview:<语言>=<id>`、`voiceCloneFile:<wav>`、`voicePicker:<on|off>`
- 诊断:`diagnostics:<on|off>`、`diagReport`
- 语音模型与“听不出”:`models:<已装,…>/<系统语言,…>` 假装本机只装了这些语音模型、系统是这些语言(`models:none/zh-Hans-CN` 是一个都没装,末尾加 `@<秒>` 让后台下载至少花这么久;之后下载的会加进来),`models:off` 回到真实情况;`source:<auto|locale>` 改“听到”(自动识别或指定语言),`pickLanguage:<locale>` 等于在“听不出”里点这种语言,`releaseModel:<locale>` 退还一个本 App 保留的语音模型。`modelFail:<offline|disk|limit|other>` 让之后的语音模型下载都按这个原因失败(`modelFail:off` 结束),`network:<on|off|real>` 假装断网、联网或跟随真实网络,`modelRetry` 等于点“再试一次”。`cloud:on` 等于点“先用 ○○ 听”(下载慢时让 AI 服务代听,只有 Ling 能听),`cloud:off` 等于点“换回等待”,`cloud:decline` 等于点“继续等”,`cloud:state` 把服务、是否提供、是否在听、正在下载哪个模型写进日志;配 `models:…@<秒>` 测下载慢、装好后自动换回(日志 `cloud: … is on the Mac`)。用没装过的语言(比如法语)能测真实的后台下载;注意 macOS 每个 App 最多保留 5 种语音模型
+ - Dock:`dock:<on|off>` 改“在 Dock 中显示”,`dockRender:<png>` 画出当前的 Dock 图标(录音时带橙点),`state:display` 里的 `dock` 是否显示在 Dock
- 更新与登录项:`updateFeed:<url>`、`updateCheck`、`updateInstall`、`updateState`、`loginItem[:on|off]`
- 完整、最新的清单以 `AppModel.debugCommand` 里的 `switch` 为准。