Macの最も無駄なキーに
最高の仕事を与える
Caps Lock becomes a physical keep-awake switch. Flip it on, close the lid, and let your background work keep running.
macOS 14 Sonoma+ · Swift 6
Caps Lock on
Runs pmset -a disablesleep 1 — sleep is disabled.
Caps Lock off
Runs pmset -a disablesleep 0 — normal sleep behavior.
One switch for closed-lid work
When a long-running local job should keep going while you step away, flip Caps Lock on. Close the lid. Capsomnia keeps the machine awake until you flip it back.
-
AI coding agents
Let Codex or Claude Code keep working on long tasks while the lid is shut.
-
SSH sessions
Drive your Mac remotely without it dropping into sleep mid-session.
-
Builds & downloads
Long compiles and large downloads finish on their own time.
-
Unattended scripts
Batch jobs and overnight scripts run to completion, untouched.
Why not caffeinate?
caffeinate は、Macを開いているときのアイドルスリープ防止には便利です。しかし、蓋を閉じれば実行中のプロセスは通常停止してしまいます。
Capsomniaは pmset -a disablesleep 1 を使い、システムスリープそのものを無効化します。蓋を閉じてもローカル作業を続けられ、Caps LockのLEDがその状態を示すため画面を汚しません。
Install from source
Capsomnia is distributed as source for now. The install script builds
Capsomnia.app locally and sets everything up.
git clone https://github.com/fuji-mak/Capsomnia.git
cd Capsomnia
./scripts/install.sh
-
Capsomnia.appをローカルでビルドします。 -
アプリを
~/Applications/に配置します。 - スリープ制御用helperを配置します。
-
helperの
on/off/display-sleepだけを許可します。 - LaunchAgentを登録し、ログイン時に起動します。
Requires macOS 14 or later, a Swift 6 toolchain, and administrator access during installation.
Security model
The menu bar app runs as the current user — never as root. Changing system sleep settings needs elevated
privileges, so Capsomnia uses one small, fixed, root-owned helper through passwordless sudo.
The app can only invoke
sudo -n /Library/PrivilegedHelperTools/capsomnia-pmset on
sudo -n /Library/PrivilegedHelperTools/capsomnia-pmset off
sudo -n /Library/PrivilegedHelperTools/capsomnia-pmset display-sleep
The sudoers rule is limited to these three exact commands.
The helper only ever runs
/usr/bin/pmset -a disablesleep 1
/usr/bin/pmset -a disablesleep 0
/usr/bin/pmset displaysleepnow
It accepts on, off, and display-sleep and nothing else.
Quitting the app, or running ./scripts/uninstall.sh, restores normal sleep behavior.
Sleep-disabled closed-lid use can increase heat and battery drain — mind airflow, power, and runtime.