From 1c997751b74a69743269c3e72030fdfbbdbcc3b0 Mon Sep 17 00:00:00 2001 From: maxsoch Date: Mon, 13 Jul 2026 19:11:39 +0200 Subject: [PATCH] add keyboard shortcuts for Cleanup (C) and Tips (T) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ⌥ purge alternate carries the same key equivalent as Cleanup — alternate pairing requires it — so ⌥C triggers the purge variant. The shortcut list in the Tips window is updated accordingly. Co-Authored-By: Claude Fable 5 --- BrewBar/BrewBarApp.swift | 9 +++++---- BrewBar/TipsWindowController.swift | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/BrewBar/BrewBarApp.swift b/BrewBar/BrewBarApp.swift index 2b16c82..afb85df 100644 --- a/BrewBar/BrewBarApp.swift +++ b/BrewBar/BrewBarApp.swift @@ -95,9 +95,10 @@ class AppDelegate: NSObject, NSApplicationDelegate { outdatedItem.submenu = outdatedSubmenu outdatedItem.isHidden = true // shown once a fetch finds outdated packages menu.addItem(outdatedItem) - menu.addItem(NSMenuItem(title: "🧹 Cleanup", action: #selector(cleanupAction), keyEquivalent: "")) - // isAlternate swaps this in for the item right above while ⌥ is held - let purgeItem = NSMenuItem(title: "🧹 Cleanup (purge cache)", action: #selector(cleanupPurgeAction), keyEquivalent: "") + menu.addItem(NSMenuItem(title: "🧹 Cleanup", action: #selector(cleanupAction), keyEquivalent: "c")) + // isAlternate swaps this in for the item right above while ⌥ is held; + // the pairing requires the same key equivalent with other modifiers + let purgeItem = NSMenuItem(title: "🧹 Cleanup (purge cache)", action: #selector(cleanupPurgeAction), keyEquivalent: "c") purgeItem.keyEquivalentModifierMask = .option purgeItem.isAlternate = true menu.addItem(purgeItem) @@ -106,7 +107,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { menu.addItem(NSMenuItem.separator()) menu.addItem(NSMenuItem(title: "⚙️ Settings…", action: #selector(showSettings), keyEquivalent: ",")) - menu.addItem(NSMenuItem(title: "💡 Tips", action: #selector(showTips), keyEquivalent: "")) + menu.addItem(NSMenuItem(title: "💡 Tips", action: #selector(showTips), keyEquivalent: "t")) versionItem = NSMenuItem(title: "🏷 Brew: ...", action: nil, keyEquivalent: "") menu.addItem(versionItem) diff --git a/BrewBar/TipsWindowController.swift b/BrewBar/TipsWindowController.swift index 5d0a97c..8919e93 100644 --- a/BrewBar/TipsWindowController.swift +++ b/BrewBar/TipsWindowController.swift @@ -9,7 +9,7 @@ class TipsWindowController: NSWindowController { "With the menu open, hold Option (⌥): Cleanup becomes Cleanup (purge cache), which also empties Homebrew's download cache (brew cleanup --prune=all). Downloads are simply re-fetched when next needed."), ("Keyboard shortcuts", - "While the menu is open: R refreshes, U upgrades formulae & casks, L opens the logs, comma (,) opens Settings and Q quits."), + "While the menu is open: R refreshes, U upgrades formulae & casks, C cleans up, L opens the logs, T shows these tips, comma (,) opens Settings and Q quits."), ("Upgrade only one kind", "When both formulae and casks are outdated, an “Upgrade only…” submenu appears under the main upgrade item to handle just one of the two."),