Repository navigation
feat: keep the Mac awake indefinitely from Amphetamine's slider - #27
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
"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 theindefinitelyaction already did), from the slider during a session or from a click. Theindefinitelyaction still works.session.sh: for 0,durationLabelis ∞,timedLabelis "Keep awake indefinitely" and the newtimedIconfield isinfinity(timerotherwise).timedIcon. The separate Keep awake indefinitely row is gone.minimumVersionis0.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
osascriptagainst Amphetamine (automation, declared), needs no extra tools and contacts no hosts.control.shwrites only$CONFIG_DIR/amphetamine-duration, now possibly with 0. The popup no longer runscontrol.sh indefinitely; the remaining commands arecontrol.sh duration,stop,timedandsession.sh.Testing
STABLEBAR=/Applications/StableBar.app/Contents/MacOS/StableBar ./scripts/check-package.sh packages/amphetaminewith 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/mainpasses. ShellCheck isn't installed here, so CI's Lint runs it;sh -npasses on all three scripts.The scripts offline, with a fake
osascripton the PATH: the end stop'sVALUE=0.0saves60 0,session.shthen prints ∞, "Keep awake indefinitely" andinfinity, 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 0andduration 0during a session start duration 0, interval 0.duration 0with no session only saves the choice.duration 120,timed 45,indefinitelyandtoggleduring a session behave as before.The popup, drawn offscreen by that StableBar with sample data, timed and on ∞:
The hover slider, recorded live in StableBar#404 with this layout and a script that records
VALUEinstead of calling Amphetamine:Not checked: a real Amphetamine session started from the end stop. It uses the same AppleScript call as the
indefinitelyaction that 1.1.0 tested live.Claude Opus 5.5 via Claude Code