Keep Mac Awake via URL Scheme, CLI, Raycast and Shortcuts
Keep your Mac awake from Raycast, Alfred, a script or Shortcuts with Glowmoth's URL scheme, CLI and actions, plus fixes when a trigger does nothing.
Updated 7 min read
On this page
You set up a launcher trigger to keep your Mac awake, and it blinks, does nothing, or says it is active when the Mac still sleeps. Users report this kind of failure with other keep-awake tools: a Raycast extension that flashes and does nothing on macOS Sequoia, and a URL scheme where "Activate URI schemes doesn't work anymore" because activate and deactivate both ended up deactivating. This page covers the three ways to drive Glowmoth without a window, and how to check each one.
Why a trigger does nothing
Launcher extensions are a thin layer over something else, and each layer can fail quietly. These are the causes, most common first.
- No valid license or trial. Glowmoth holds no power assertion without one. URLs do nothing, the CLI prints "Glowmoth needs a license. Open Glowmoth to activate it.", and Shortcuts shows the same message.
- The launcher can't find the command. Raycast and Alfred often run shell commands without your PATH, so
glowmothis "not found" even though it works in Terminal. - The URL isn't quoted. In a shell,
?and&have special meaning, so an unquoted URL gets mangled. - A third-party extension reports success without checking. Glowmoth has no official Raycast or Alfred extension, and no AppleScript dictionary. Generic shell or URL steps are the supported route.
- Something else sleeps the Mac anyway. A safety pause (low battery or heat), a closed lid, or a scheduled
pmsetsleep can override a session that started correctly.
Route 1: the glowmoth:// URL scheme
The URL scheme is handled without bringing Glowmoth forward or opening a window. Quote the URL.
open --background 'glowmoth://start?minutes=30'| URL | What it does |
|---|---|
glowmoth://start | Starts your default duration (Indefinitely unless you changed it). Aliases: on, activate. |
glowmoth://start?minutes=30 | Keeps awake for 30 minutes. |
glowmoth://start?hours=2 | Keeps awake for 2 hours. hours and minutes combine; decimals work. |
glowmoth://start?until=18:00 | Keeps awake until 18:00. Also 1800, 6pm, 6:30 pm. A time already passed means tomorrow. |
glowmoth://start?duration=1h30 | Keeps awake for 1 hour 30 minutes. |
glowmoth://start?indefinitely | Keeps awake until you stop it. |
glowmoth://stop | Ends your session. Aliases: off, deactivate. |
glowmoth://toggle | Starts your default duration, or stops the running session. |
glowmoth://extend?minutes=15 | Adds 15 minutes; a negative number removes time. Alias: adjust. |
Add display=1 or display=0 (also true/false, yes/no, on/off) to start or toggle to choose whether the display stays on. A timed session can last at most 7 days; use indefinitely for longer. The form glowmoth:start without slashes is also accepted.
Route 2: the glowmoth command-line tool
Install it
- Open Glowmoth Settings (Settings… in the panel footer or right-click menu, or ⌘,).
- Go to Advanced, then Command Line.
- Next to Command-line tool, click Install.
This symlinks the bundled tool to ~/.local/bin/glowmoth. Uninstall removes it. If your shell can't find the command, add ~/.local/bin to your PATH.
Commands
| Command | What it does |
|---|---|
glowmoth on | Keeps awake with your default duration. --display or --no-display sets display behavior. |
glowmoth off | Stops your session. |
glowmoth toggle | Starts or stops your session. |
glowmoth for 1h30 | Keeps awake for a duration (90, 1h30, 2h 15m). |
glowmoth until 18:00 | Keeps awake until a time (6pm works). |
glowmoth extend 15 | Adds minutes; -15 removes them. |
glowmoth status [--json] | Reports state. |
glowmoth wait <pid> | Stays awake until that process exits. |
glowmoth run -- <command> | Stays awake while the command runs, then returns its exit code. |
If Glowmoth isn't running, on, for, until, toggle and extend launch it in the background and print "Started Glowmoth." The commands off, status and lease print that Glowmoth isn't running and exit with 2.
Verify from a script
glowmoth status exits 0 when awake, 1 when not, and 2 when Glowmoth isn't running. With --json it prints state (idle, awake or paused), awake, keepsDisplayOn, endDate and a holders list. When the app isn't running it prints {"awake":false,"running":false,"state":"not-running"}.
glowmoth on && glowmoth status
echo "exit code: $?"You can also check outside Glowmoth. It holds one power assertion named like "Glowmoth: Session for 1 hour", visible in this read-only command:
pmset -g assertionsHold the Mac for a command, a process or a lease
glowmoth run -- make keeps the Mac awake while make runs and returns its exit code (127 if it couldn't start). glowmoth wait 1234 does the same for a process ID. If the app isn't running or goes away, both hold their own assertion, so they still work in scripts.
For long jobs, glowmoth lease acquire --id <id> [--label <text>] [--ttl <seconds>] holds the Mac until glowmoth lease release --id <id>. Renew with glowmoth lease heartbeat --id <id>. A lease ends by itself when its TTL (5 to 86,400 seconds, default 300) passes without a heartbeat. Argument errors exit with 64.
Route 3: Shortcuts and Siri
Glowmoth adds six actions to Shortcuts. They run in the background without opening a window.
| Action | Notes |
|---|---|
| Start Keeping Awake | Optional Minutes, Until (used when Minutes is empty), Keep Display On. Empty means your default duration. |
| Stop Keeping Awake | Also Pause Automatic Reasons is off by default; turn it on to act like Stop Everything. |
| Toggle Keeping Awake | Returns true if a session is now running. |
| Adjust Keep-Awake Time | Minutes (default 15); negative removes time. With no session, it starts one. |
| Set Automatic Mode | Switches between Automatic and Manual. |
| Get Keep-Awake Status | Returns Is Awake, End Date, Reasons, Keeps Display On. |
Phrases: "Keep my Mac awake with Glowmoth" or "Start Glowmoth"; "Let my Mac sleep with Glowmoth" or "Stop Glowmoth"; "Toggle Glowmoth"; "Is Glowmoth keeping my Mac awake".
Raycast and Alfred setup
Neither has an official Glowmoth extension, so use their generic shell or URL steps. Create a Raycast script command or an Alfred workflow step that runs open --background 'glowmoth://start?minutes=30', and a second one for glowmoth://stop. If you prefer the CLI, call it by full path (~/.local/bin/glowmoth) so the launcher's missing PATH doesn't matter. Alfred's "Open URL" step also works with the glowmoth:// links.
Checklist before you try again
- Glowmoth shows no "Your trial has ended" or "Your license couldn't be verified" message in its panel.
- The URL is wrapped in single quotes.
- The CLI is installed, or you call it by full path.
glowmoth statusexits 0 after your trigger runs.- The panel icon isn't in the Paused state.
Fixes for specific symptoms
| Symptom | Cause | Fix |
|---|---|---|
| Nothing happens, no error | No valid license or trial | Open the panel, enter a license with Enter License… |
| Command not found | ~/.local/bin not on PATH | Add it, or use the full path |
| Install says the path "already exists and isn't Glowmoth's" | Another file sits at ~/.local/bin/glowmoth | Remove it, then install again |
| "Glowmoth isn't running." exit 2 | App not open | Start it, or use on, for or until |
| Session runs but Mac sleeps | Safety pause, lid closed | See the notes below |
| Display behaves wrongly | Default applies | Pass display= or --display / --no-display |
| Duration rejected | Format | Use 90, 1h30, 2h 15m; times like 18:00, 6pm |
To see whether another app or a pmset schedule is involved, read See what's keeping your Mac awake.
If nothing works
Contact support through the MacSuite support page. Include the exact message, what glowmoth status --json prints, and the trigger you used.
Subject: Glowmoth trigger does nothing
Glowmoth version: (from About Glowmoth)
macOS version:
Trigger: URL / CLI / Shortcuts / Raycast / Alfred
Command or URL used:
Output of "glowmoth status --json":
Message shown in the Glowmoth panel (license, Paused):
Already tried: quoted the URL, full CLI path, checked license.Common questions
Is there an official Raycast or Alfred extension?
No. Use a shell command or an "Open URL" step; both routes are supported and need no extension.
Can I script it with AppleScript?
Glowmoth has no AppleScript dictionary. Use the URL scheme, the CLI or Shortcuts. In an AppleScript, you can still call do shell script with the CLI path.
Does it need special permissions?
No. Accessibility and Input Monitoring are not needed. Hotkeys, URLs, CLI and Shortcuts all work without them.
Do these routes work when the menu bar icon is hidden?
Yes. A crowded menu bar or the notch can hide the icon, and all three routes still work.
Glowmoth is part of MacSuite, so one license covers it; see Glowmoth and Shortcuts, Siri and the glowmoth:// URL scheme for the full reference, and the command-line tool for every CLI option.