Skip to content

feat: keep the Mac awake indefinitely from Amphetamine's slider - #27

Merged
M4n0x merged 1 commit into
mainfrom
feat/amphetamine-endless-stop
Nov 1, 2026
Merged

M4n0x merged 1 commit into
mainfrom
feat/amphetamine-endless-stop

Conversation

@M4n0x

@M4n0x M4n0x commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Package

Amphetamine 1.2.0. Past a notch after 240 minutes, the hover slider and the popup slider stop on ∞, which keeps the Mac awake indefinitely. With the default click setting (toggle), the hover slider is the only control, and until now it couldn't start an indefinite session. This uses the slider end stop that Seb-GRAF/StableBar#404 added for Seb-GRAF/StableBar#399.

Changes

  • Sliders: both get "endStop": { "value": 0, "label": "∞" }. Dragging past 240 holds the knob there, then snaps it onto ∞. The value label reads ∞, centered in its 38-point slot, where ∞ looked lost on the left.
  • control.sh: a duration of 0 starts an indefinite session (duration 0 and interval 0, as the indefinitely action already did), from the slider during a session or from a click. The indefinitely action still works.
  • session.sh: for 0, durationLabel is ∞, timedLabel is "Keep awake indefinitely" and the new timedIcon field is infinity (timer otherwise).
  • Popup: the start row follows the slider, with its icon from timedIcon. The separate Keep awake indefinitely row is gone.
  • Manifest: version 1.2.0, the description mentions the indefinite session, and minimumVersion is 0.10.0-beta.20261101132945.557, the first StableBar with slider end stops. No stable release has them yet. The package README and the store table follow.

Access

Unchanged: the package runs osascript against Amphetamine (automation, declared), needs no extra tools and contacts no hosts. control.sh writes only $CONFIG_DIR/amphetamine-duration, now possibly with 0. The popup no longer runs control.sh indefinitely; the remaining commands are control.sh duration, stop, timed and session.sh.

Testing

  • STABLEBAR=/Applications/StableBar.app/Contents/MacOS/StableBar ./scripts/check-package.sh packages/amphetamine with StableBar 0.10.0-beta.20261101132945.557: inspect, install into a scratch configuration and validate pass ("Valid configuration: 1 widgets in 5 files"). ./scripts/check-versions.sh origin/main passes. ShellCheck isn't installed here, so CI's Lint runs it; sh -n passes on all three scripts.

  • The scripts offline, with a fake osascript on the PATH: the end stop's VALUE=0.0 saves 60 0, session.sh then prints ∞, "Keep awake indefinitely" and infinity, and a click passes 0 to the AppleScript. 120 and the icon-only bar still print what they did.

  • The AppleScript with Amphetamine's commands stubbed: toggle 0 and duration 0 during a session start duration 0, interval 0. duration 0 with no session only saves the choice. duration 120, timed 45, indefinitely and toggle during a session behave as before.

  • The popup, drawn offscreen by that StableBar with sample data, timed and on ∞:

    The Amphetamine popup timed at 120 minutes and on ∞, in dark and light
  • The hover slider, recorded live in StableBar#404 with this layout and a script that records VALUE instead of calling Amphetamine:

    Dragging the hover slider to 240, onto ∞ with its label centered, and back
  • Not checked: a real Amphetamine session started from the end stop. It uses the same AppleScript call as the indefinitely action that 1.1.0 tested live.

Claude Opus 5.5 via Claude Code

Amphetamine 1.2.0 uses StableBar's new slider end stop: past a notch after 240 minutes, both
sliders stop on ∞, which sends 0. A duration of 0 starts an indefinite session (duration and
interval 0, as Amphetamine expects), from the slider during a session or from a click.

The value label reads ∞, centered in its slot, and the popup's start row follows the slider,
with a timer or infinity icon, so its separate Keep awake indefinitely row is gone. It needs
StableBar 0.10.0-beta.20261101132945.557, the first with slider end stops.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner November 1, 2026 13:54
@M4n0x
M4n0x merged commit a5c99bd into main Nov 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant