A tiny macOS menu bar app that keeps your Mac awake — on your terms. Flip sleep on or off in a click, prevent sleep for a set time, or set a recurring weekly schedule. No dependencies, no background daemons, just a single Swift binary.
🦉 Constant vigilance.
caffeinate and pmset already do this from the terminal, but you have to
remember the flags, and caffeinate dies when you close the shell. Vigilus puts
both in the menu bar with sane defaults and remembers your state across launches.
- Prevent / Allow Sleep — a one-click power assertion (like
caffeinate), no admin password needed. Optionally keep the display awake too. - Prevent Sleep for… — a timed window (15 min → 4 hours) with a live countdown in the menu. Auto-resumes if you quit and relaunch mid-timer.
- Weekly schedule — recurring rules ("keep awake Mon–Fri, 9am–6pm"). Overlapping windows are merged automatically.
- System sleep settings — toggle idle sleep permanently per power source
(AC / Battery) via
pmset. Remembers and restores your real timer instead of leaving it at "Never". Requires admin auth (native macOS dialog). - Launch at Login — register via
SMAppService, no helper bundle. - Menu bar icon reflects state at a glance: 🔥 awake / 🌙 sleep allowed.
Grab the latest Vigilus-*.zip from the
Releases page. It's
a universal build that runs natively on both Apple Silicon and Intel Macs
(macOS 13+).
- Unzip it — you'll get
Vigilus.app. - Drag
Vigilus.appinto your/Applicationsfolder. - Launch it. Because the app is ad-hoc signed (not notarized), the first launch may be blocked by Gatekeeper — right-click → Open, then confirm, or allow it under System Settings → Privacy & Security.
Vigilus runs as a menu bar accessory (LSUIElement) — no Dock icon.
Requires macOS 13+ and the Swift toolchain (Xcode or Command Line Tools —
verify with swift --version).
git clone git@github.com:dationguyen/Vigilus.git
cd Vigilus
./build.shThis compiles Sources/*.swift into a universal binary, assembles
build/Vigilus.app, and ad-hoc code-signs it.
open build/Vigilus.app # run it
cp -r build/Vigilus.app /Applications/ # install itClick the menu bar icon:
| Action | What it does | Admin? |
|---|---|---|
| Prevent / Allow Sleep | Toggle a power assertion now | No |
| Prevent Sleep for ▸ | Keep awake for a fixed duration | No |
| Also Keep Display Awake | Hold the display on as well as the system | No |
| Edit Schedule… | Manage recurring weekly keep-awake rules | No |
| Sleep on AC / Battery | Permanently enable/disable idle sleep per source | Yes |
| Launch at Login | Start Vigilus automatically | No |
The temporary and permanent controls are independent: power assertions stop when
the app quits, while pmset changes persist system-wide until you flip them back.
- Temporary sleep prevention uses IOKit power assertions
(
kIOPMAssertionTypePreventUserIdleSystemSleep/kIOPMAssertionTypeNoDisplaySleep) — no privileges required. - Permanent changes shell out to
/usr/bin/pmsetvia the native admin authorization dialog, and read configured timers back frompmset -g custom. - Preferences (display-awake choice, schedule rules, saved sleep timers, current
manual state) persist in
UserDefaults.
Sources/main.swift Menu bar app, power assertions, pmset, login item
Sources/Scheduler.swift Recurring weekly schedule engine + editor window
build.sh Compiles, bundles, and signs Vigilus.app
If Vigilus saves you a few trips to the terminal, you can buy me a coffee ☕
MIT © 2026 Thanh Dat Nguyen