Repolode
fuji-mak

fuji-mak/Capsomnia

A small macOS menu bar app that uses Caps Lock as a switch to keep a closed-lid MacBook awake for long-running work.

Open-source alternative to:AmphetamineCaffeine

Stars
444
Forks
42
Open issues
5
Last commit
5 days ago

What is it?

Capsomnia turns the Caps Lock key into a physical on/off switch for sleep prevention on macOS. When Caps Lock is on, the Mac stays awake even with the lid closed, so local jobs, AI coding agents, SSH sessions, builds, and downloads keep running. Turning Caps Lock off restores normal sleep behavior, and the Caps Lock light shows the current state.

The app runs as a menu bar item and does not run as root. System sleep changes go through a small compiled helper invoked via a narrowly scoped passwordless sudo rule. Optional features include an auto-off timer, a custom toggle shortcut, a "Keep display awake" mode that dims only the built-in display while the lid is closed, and an option to prevent all-caps typing. It also offers an optional hotspot keep-alive probe and a lid-open lock for use with computer-use tools.

A signed and notarized Apple silicon package is available, and source installation via a script supports Apple silicon and Intel Macs. The project collects no telemetry and requires no account.

Key features

  • 01Caps Lock on keeps the Mac awake with the lid closed; off restores normal sleep.
  • 02Optional auto-off timer ranging from 15 minutes to 8 hours or a custom duration.
  • 03Custom global shortcut to toggle awake mode regardless of Caps Lock assignment.
  • 04"Keep display awake" mode dims only the built-in display while the lid is closed.
  • 05Optional prevention of all-caps typing, with Accessibility permission used only for that feature.
  • 06Privileged operations run through a fixed helper limited to six exact sudo commands.

Use cases

  • Keeping AI coding agents or long builds running while the MacBook is closed in a bag or dock.
  • Accessing a closed-lid Mac remotely through SSH or mobile tools.
  • Running unattended downloads or scripts overnight on a laptop.
  • Keeping a personal hotspot connected while working away from a desk.

Quick start

  1. 1

    Download Capsomnia.pkg from GitHub Releases

  2. 2

    Open the package and follow the installer

Things to know

  • macOS only; the signed package requires an Apple silicon Mac on macOS 14 or later.
  • Closed-lid use may increase heat and battery consumption, so ensure airflow and a stable power source.
  • Compatibility is not guaranteed for every Mac, macOS version, or environment, and it is provided at your own risk.
  • Preventing all-caps typing requires macOS Accessibility permission.

In collections

Topics

FAQ

What is Capsomnia?
A small macOS menu bar app that uses Caps Lock as a switch to keep a closed-lid MacBook awake for long-running work. Capsomnia turns the Caps Lock key into a physical on/off switch for sleep prevention on macOS. When Caps Lock is on, the Mac stays awake even with the lid closed, so local jobs, AI coding agents, SSH sessions, builds, and downloads keep running. Turning Caps Lock off restores normal sleep behavior, and the Caps Lock light shows the current state.
Is Capsomnia free to use? What license does it have?
Capsomnia is open source under the MIT license. Check the license terms before using it in commercial products.
Is Capsomnia still maintained?
Actively maintained. The last commit to Capsomnia was on Nov 2, 2026.
What can I use Capsomnia for?
Keeping AI coding agents or long builds running while the MacBook is closed in a bag or dock. Accessing a closed-lid Mac remotely through SSH or mobile tools. Running unattended downloads or scripts overnight on a laptop. Keeping a personal hotspot connected while working away from a desk.
How do I install Capsomnia?
Download Capsomnia.pkg from GitHub Releases Open the package and follow the installer
Where can I get Capsomnia?
The source code and installation instructions are on GitHub: https://github.com/fuji-mak/Capsomnia

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects