Skip to content

feat: add a preview for the Amphetamine package - #30

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

M4n0x merged 1 commit into
mainfrom
feat/amphetamine-preview

Conversation

@M4n0x

@M4n0x M4n0x commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Package

Amphetamine 1.2.1. It was the only package without a preview, so its row in the README and its Store card had no picture. It now shows the bar widget during a timed session: the pill and 42 minutes left.

Amphetamine's bar widget: a filled pill and 42m in a white tile on a light grey background

This also lets setup suggest Amphetamine when it finds the app (#28, stablebox/StableBar#405): the suggestions check requires a preview. Once this and #28 are both merged, one line in suggestions.json adds it: { "when": { "apps": ["com.if.Amphetamine"] }, "packages": ["amphetamine"] }. I kept it out of this pull request so the two don't depend on each other.

Changes

  • preview.png: 520 × 144, like the other previews. StableBar main drew it offscreen with --render-scenes from the installed package, so the widget is the package's own layout with sample output, not a mock-up. The scene's tile and background match the existing previews: drawing Homebrew outdated the same way gives the same tile position and size as its published preview.
  • Manifest: "screenshot": "preview.png" and version 1.2.1. The scripts and config.json don't change.
  • README: the package list shows the preview (./scripts/update-readme.sh).

Access

Unchanged: osascript against Amphetamine (automation), no tools in requires, no hosts.

Testing

  • STABLEBAR=<StableBar main, cdafc4b> ./scripts/check-package.sh packages/amphetamine: inspect, install into a scratch configuration and validate pass ("Valid configuration: 1 widgets in 3 files"). ./scripts/check-versions.sh origin/main passes.

  • With this preview, feat: list the packages StableBar's setup suggests for tools found on the Mac #28's scripts/check-suggestions.sh passes with Amphetamine added to suggestions.json.

  • Drawn offscreen only: nothing ran and no second bar opened. The package was installed into a scratch configuration with --config … --install-package, and the scene sat beside it:

    Scene and configuration

    scene.json:

    {
      "configuration": "config.json",
      "outputs": { "amphetamine": { "text": "42m", "icon": "pill.fill", "values": { "duration": 60 } } },
      "draw": "bar", "appearances": ["light"], "width": 260, "height": 72
    }

    config.json:

    {
      "bar": { "height": 72, "style": { "background": "#ebedf2", "borderWidth": 0, "cornerRadius": 0 } },
      "defaults": { "borderColor": null, "shadowColor": null },
      "packages": [{ "id": "amphetamine", "version": "1.2.0" }],
      "widgetOverrides": { "amphetamine": { "position": "center", "style": { "height": 34, "paddingHorizontal": 12, "background": "#ffffff" } } }
    }

    The scene frame's rounded edge was painted over with the background colour afterwards.

Claude Opus 5.5 via Claude Code

@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner November 1, 2026 14:26
@M4n0x
M4n0x merged commit 087c32d 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