Skip to content
86% off$349 $48.86code BF2026

Docs

Glowmoth docs25 pages

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.

  1. 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.
  2. The launcher can't find the command. Raycast and Alfred often run shell commands without your PATH, so glowmoth is "not found" even though it works in Terminal.
  3. The URL isn't quoted. In a shell, ? and & have special meaning, so an unquoted URL gets mangled.
  4. 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.
  5. Something else sleeps the Mac anyway. A safety pause (low battery or heat), a closed lid, or a scheduled pmset sleep 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.

bash
open --background 'glowmoth://start?minutes=30'
URLWhat it does
glowmoth://startStarts your default duration (Indefinitely unless you changed it). Aliases: on, activate.
glowmoth://start?minutes=30Keeps awake for 30 minutes.
glowmoth://start?hours=2Keeps awake for 2 hours. hours and minutes combine; decimals work.
glowmoth://start?until=18:00Keeps awake until 18:00. Also 1800, 6pm, 6:30 pm. A time already passed means tomorrow.
glowmoth://start?duration=1h30Keeps awake for 1 hour 30 minutes.
glowmoth://start?indefinitelyKeeps awake until you stop it.
glowmoth://stopEnds your session. Aliases: off, deactivate.
glowmoth://toggleStarts your default duration, or stops the running session.
glowmoth://extend?minutes=15Adds 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

  1. Open Glowmoth Settings (Settings… in the panel footer or right-click menu, or ⌘,).
  2. Go to Advanced, then Command Line.
  3. 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

CommandWhat it does
glowmoth onKeeps awake with your default duration. --display or --no-display sets display behavior.
glowmoth offStops your session.
glowmoth toggleStarts or stops your session.
glowmoth for 1h30Keeps awake for a duration (90, 1h30, 2h 15m).
glowmoth until 18:00Keeps awake until a time (6pm works).
glowmoth extend 15Adds 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"}.

bash
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:

bash
pmset -g assertions

Hold 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.

ActionNotes
Start Keeping AwakeOptional Minutes, Until (used when Minutes is empty), Keep Display On. Empty means your default duration.
Stop Keeping AwakeAlso Pause Automatic Reasons is off by default; turn it on to act like Stop Everything.
Toggle Keeping AwakeReturns true if a session is now running.
Adjust Keep-Awake TimeMinutes (default 15); negative removes time. With no session, it starts one.
Set Automatic ModeSwitches between Automatic and Manual.
Get Keep-Awake StatusReturns 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 status exits 0 after your trigger runs.
  • The panel icon isn't in the Paused state.

Fixes for specific symptoms

SymptomCauseFix
Nothing happens, no errorNo valid license or trialOpen the panel, enter a license with Enter License…
Command not found~/.local/bin not on PATHAdd it, or use the full path
Install says the path "already exists and isn't Glowmoth's"Another file sits at ~/.local/bin/glowmothRemove it, then install again
"Glowmoth isn't running." exit 2App not openStart it, or use on, for or until
Session runs but Mac sleepsSafety pause, lid closedSee the notes below
Display behaves wronglyDefault appliesPass display= or --display / --no-display
Duration rejectedFormatUse 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.

text
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.

Every app.
One purchase.