Releases: onlywsx/Caffeine
Releases · onlywsx/Caffeine
Release list
Caffeine 1.6.6
Caffeine 1.6.6
Changed
- "Start at login" service is now a single concrete
LoginItemService(@MainActor,@Observable) injected intoCaffeineViewModellike the other services (SleepPreventionManager,ActivitySimulator). TheLoginItemServiceprotocol,LiveLoginItemService,FakeLoginItemService, and the\.loginItemenvironment key are gone. Previews constructLoginItemService(inMemoryWith: .disabled)and pass it via the view-model initializer; the runtime path queriesSMAppService.mainAppon launch and on everysetEnabled(_:)call. - Menu bar icons now use SF Symbols for both states. Active:
leaf.fill. Inactive:leaf. Theactiveandinactiveasset images are no longer referenced by the app. SF Symbols are provided by Apple free of charge for use inside apps, including commercial and App Store distribution — no licence fee, no attribution required.
Added
- Settings window now has a four-tab layout: General (core behaviour preferences), Power (display sleep, power adapter, and battery preferences), Keyboard (global toggle shortcut), and About (app version, description, GitHub link, Check for Updates).
- Global toggle shortcut in Settings → Keyboard. By default the shortcut is
⌘⇧C(Command+Shift+C); the user can record any key combination and disable/enable the shortcut from the Keyboard tab. The shortcut is registered via Carbon'sRegisterEventHotKeyAPI so it works system-wide, even when Caffeine is not the frontmost app, and does not require Accessibility permission. - "Check for Updates" moved from the menu bar item to the About tab.
- "Start at login" preference in Settings → General. When enabled, Caffeine registers itself with
SMAppService.mainAppso it launches automatically on user login. Default is off. - "Allow display to sleep" preference in Settings → Power. When enabled (the default), Caffeine holds only the system idle assertion so the display can sleep on its normal schedule while the Mac stays awake. When disabled, Caffeine holds the stricter display assertion that also keeps the display awake.
- "Activate when power adapter is connected" preference in Settings → Power. When enabled, Caffeine automatically activates when a power adapter is connected. Default is off.
- "Deactivate when power adapter is disconnected" preference in Settings → Power. When enabled, Caffeine automatically deactivates when the power adapter is disconnected. Default is off.
- "Deactivate on low battery" preference in Settings → Power with a configurable threshold slider (5–50 %, default 20 %). When enabled, Caffeine automatically deactivates when the internal battery drops below the threshold. Desktop Macs without a battery are unaffected.
Fixed
- "Allow display to sleep", "Activate when power adapter is connected", "Deactivate when power adapter is disconnected", "Deactivate on low battery" toggles and the low-battery threshold slider could not be toggled/adjusted. Their custom
Bindingclosures called view-model methods without first writing the new value back toSettingsModel, so the getter always returned the stale value and SwiftUI reverted the control. - "Default duration" preference in Settings → General now takes effect within the current session, not only on the next app launch. Previously,
CaffeineAppandCaffeineViewModeleach constructed their ownSettingsModel, so a Picker change in the Settings window updated the app's instance while the view model read the stale copy.CaffeineViewModelnow receives the shared instance via injection, and the parameter is non-optional to prevent the same mistake from recurring.
Removed
- First-launch pop-up of the Settings window (and its associated "Show this message when starting Caffeine" preference). Users open Settings themselves from the menu bar via
Settings…. - Suppression of the keyboard focus ring on the Settings tab bar and on form controls; SwiftUI's default focus indicator is now shown.
Changed (additional)
- Menu bar item label renamed from
Preferences…toSettings…in every supported language. Updated across all 14Localizable.stringsfiles (en, zh-Hans, de, ja, ko, es, fr, it, nl, pt, pt-BR, ru, uk) and the source string inMenuBarContentView.swift. - Renamed the view files in
Classes/Views/to follow the*Viewconvention:GeneralSettings/AboutSettings/MenuBarContentare nowGeneralSettingsView/AboutSettingsView/MenuBarContentView. - Menu bar
inactiveicon is now a coffee bean (with a central groove) instead of an empty cup, so the two states are clearly different shapes rather than "full cup vs empty cup" variants. - Settings window minimum width and default size widened from 380pt to 440pt so toggles and labels no longer hug the edge.
- Settings window now uses the native
Settings { TabView { Tab { ... } } }API (macOS 14+), removing the custom tab buttons and theSettingsTabButtonStyleworkaround. Tab theming now follows the system appearance automatically. - All user preferences are now read and written through a single
SettingsModel(@Observable), replacing scatteredUserDefaults.standard.bool(forKey:)calls inCaffeineViewModeland per-view@AppStoragebindings. AppDelegateno longer observesNSApp.effectiveAppearanceto force-update window appearance; system default behaviour is relied upon instead.- The "About" tab now uses
Formwith.formStyle(.grouped)for visual consistency with the "General" tab. - Shared state (
SettingsModel,CaffeineViewModel,LoginItemService) is now provided to views via SwiftUI's@Environmentmechanism instead of constructor parameters.CaffeineAppattaches each value at the scene level using.environment(...), and the views read them with@Environment(Type.self)(for@Observablemodels) or@Environment(\.loginItem)(for the service, via the new@Entry). This eliminates the last places where a default-parameter constructor could silently create a divergent instance, and matches Apple's recommended pattern for@Observabletypes.
⚠️ Install note (ad-hoc signed, not notarised)
This build is signed with an ad-hoc certificate and has not been notarised by Apple. macOS Gatekeeper will block the first launch with a message such as "Caffeine.app cannot be opened because it is from an unidentified developer".
To open it:
- Locate
Caffeine.appin Finder (do not open it from the archive). - Right-click (or Control-click) the app and choose Open from the context menu.
- Click Open in the dialog that appears.
After this, macOS remembers your choice and you can launch the app normally (including double-click) thereafter. If Gatekeeper refuses, you can also remove the quarantine attribute from the extracted app:
xattr -dr com.apple.quarantine /Applications/Caffeine.appAsset
Caffeine-1.6.6.zip(6.3 MB) — ad-hoc signed.appbundle- SHA-256:
9e049cf19a8e569ea061388cc65650f85d93bc25ae9b0cb80922475be902e04a
Auto-update
This release is not published to the Sparkle appcast (https://dr-caffeine-mac.s3.amazonaws.com/appcast.xml). Existing 1.6.5 installations will not be auto-updated to 1.6.6. Download and install manually from this release.
Caffeine 1.6.5
Caffeine 1.6.5 (2026-06-16)
Fixed
- Right-click on the menu bar icon no longer fails to show the context menu on macOS 27. On macOS 27 the system no longer delivers right-mouse events to
NSStatusBarButtonat the AppKit layer, so the context menu is now intercepted via a session-levelCGEventTap. This requires the user to grant Caffeine accessibility permission on first run (System Settings → Privacy & Security → Accessibility). - Timer no longer stays active and shows negative seconds after the Mac sleeps past the activation period.
Changed
- Improved Ukrainian translation.
- The time-remaining countdown is now displayed live at the top of the right-click context menu without rebuilding the menu on every tick.