Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coffee Break

Coffee Break is a lightweight, native macOS Menu Bar application designed to keep your display awake when you step away from your desk. Whether you are grabbing a cup of tea or coffee, reading a document, or presenting, Coffee Break prevents your screen from dimming or going to sleep.


Download

Get the latest release for macOS:


Key Features

  • Quietly Lives in the Menu Bar: Runs without taking up space in your Dock (Menu Bar accessory).
  • Instant One-Click Toggle: Left-click the menu bar icon to toggle sleep prevention ON or OFF immediately.
  • Preset Timers: Automatically deactivate after 15 Mins, 30 Mins, 1 Hour, or 2 Hours, or keep your screen awake Indefinitely.
  • Live Countdown Display: Easily see remaining active time at a glance.
  • Visual Status Indicator: Solid cup when active, outlined cup when inactive.
  • Zero Background Resource Waste: Pure native Apple IOKit power assertion with negligible CPU and memory usage.

How to Use

1. Quick Activation / Deactivation

  • Left-Click on the icon in your macOS menu bar to instantly turn sleep prevention ON or OFF.

2. Opening the Menu & Setting Timers

  • Right-Click (or hold Control while left-clicking) the menu bar icon to open the menu.
  • Hover over Duration to select a countdown timer preset:
    • Indefinitely (Default — stays active until you manually turn it off)
    • 15 Mins
    • 30 Mins
    • 1 Hour
    • 2 Hours

First-Time Launch (macOS Security Note)

When downloading pre-built releases directly from GitHub, macOS Gatekeeper may show a warning stating that Apple could not verify the application.

Because Coffee Break is an open-source project built without a paid Apple Developer ID subscription, you can bypass this standard Gatekeeper prompt using either of these quick steps:

  • Option A (Right-Click Open): Right-click (or Control + Left-Click) CoffeeBreak.app in Finder, click Open, and then click Open again in the prompt.
  • Option B (Terminal): Remove the internet download quarantine attribute by running:
    xattr -d com.apple.quarantine /Applications/CoffeeBreak.app

Shortcuts

Action Control / Shortcut
Toggle Active/Inactive Left-Click menu bar icon
Open Menu Right-Click menu bar icon (or Ctrl + Left-Click)
Toggle Menu Option Cmd + T (when menu is open)
Quit App Cmd + Q (when menu is open)

Building and Installation Guide

Coffee Break can be built locally using native macOS developer tools without installing third-party dependencies or package managers.

Requirements

  • macOS 13.0 (Ventura) or later
  • Xcode Command Line Tools (xcode-select --install)

Quick Setup Steps

  1. Build the Application Bundle (CoffeeBreak.app): Open Terminal in the project folder and run:

    make app
  2. Launch Coffee Break:

    make run

    Or open it directly from Finder / Terminal:

    open build/CoffeeBreak.app
  3. (Optional) Install to Applications: To install Coffee Break on your Mac, drag or copy build/CoffeeBreak.app into your /Applications folder:

    cp -R build/CoffeeBreak.app /Applications/
  4. Package Distributable DMG: If you want to package a standalone .dmg installer to share:

    make dmg

Verifying Sleep Prevention

Coffee Break uses Apple's native IOKit power management framework. You can verify that display sleep is actively disabled by running this command in Terminal:

pmset -g assertions

When Coffee Break is active, an entry will appear under PreventUserIdleDisplaySleep:

pid <ID>(CoffeeBreak): [0x0000...] PreventUserIdleDisplaySleep named: "Coffee Break - Keeping display awake (...)"

Project Layout

coffee-break/
├── .gitignore
├── Makefile
├── Package.swift
├── README.md
├── Config/
│   └── Info.plist            # App bundle metadata configuration
├── Resources/
│   ├── logo.png              # Source icon graphic
│   ├── AppIcon.png
│   └── AppIcon.icns
├── Scripts/
│   └── optimize_icon.swift   # Icon scaling script
└── Sources/
    └── CoffeeBreak/          # Swift source code
        ├── App.swift
        ├── AppState.swift
        ├── MenuView.swift
        └── PowerManager.swift

License

Released under the MIT License.

About

Native macOS menu bar application to prevent screen sleep with timer presets and zero background overhead.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages