Skip to content

Let widget scripts reach the bar that runs them #301

Closed

Description

@M4n0x

Problem

A widget script that calls the command line, to trigger an event, refresh another widget or open a popup, has two gaps:

  • It doesn't know where StableBar is. The guide's examples use /path/to/StableBar.app/Contents/MacOS/StableBar (create-a-widget.md:68-69). The stablebar command exists only once Settings installs it, and it runs the copy in Applications, which may not be the build running the script, such as a development build.
  • It doesn't know its configuration. Scripts get CONFIG_DIR but not the file (BarStore.swift:975-980). Without --config, --refresh, --popup and --query address the default configuration, and --trigger broadcasts to every bar (command-line.md:37). A script in a bar started with --config ~/work/bar.json reaches the wrong bar, or all of them.

SketchyBar passes $BAR_NAME for the same reason, and SwiftBar passes each plugin its cache and data folders.

Proposal

  • Commands get STABLEBAR, the path of the running executable, and STABLEBAR_CONFIG, the configuration file's path. As with NAME and CONFIG_DIR, event data can't replace them.
  • The command line uses STABLEBAR_CONFIG as its configuration when --config isn't given, so "$STABLEBAR" --trigger done in a widget script reaches the bar that ran it.
  • The guide's examples use "$STABLEBAR".
  • Open question: without --config, --trigger broadcasts to every bar for compatibility. With STABLEBAR_CONFIG set, it would reach one bar; scripts that relied on the broadcast would need --trigger from outside a widget.

Possible today

Partly. The top-level environment can set both paths by hand, and the script passes --config itself.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    enhancement
    on Oct 23, 2026
  2. added
    P3
    on Nov 8, 2026
  3. self-assigned this
    on Nov 16, 2026
  4. stablebar-releases commented on Nov 20, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.18.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3enhancementreleased

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions