Skip to content

Let a theme put widgets into its groups by widget type or role #727

Closed

Description

@M4n0x

Problem

A theme can style groups but can't put widgets in them. A group has only a style, and each widget joins one with its own group, which must name a defined group or the whole configuration fails to load ("Unknown group" in Sources/StableBar/Configuration.swift). So a theme drawn as pills looks like a plain strip until people edit their configuration widget by widget.

Fern, from the Store, says so in its README: "A theme can't place widgets, so the pills come from groups in your configuration." It asks for a group on each widget, plus an empty entry in groups for each one, so the configuration still loads under other themes. Those assignments stay when you switch theme, and the theme's preview and Use in the gallery don't make them.

The theme profile condition from #666 (#696, #697, in the 0.16 betas) lets people keep these assignments in a "when": { "theme": "fern" } profile, but they still write them by hand, by widget ID.

Proposal

A group can say which widgets it holds, matched by built-in widget type and role, so a theme ships its pills already filled:

"groups": {
  "workspaces": { "style": { "background": "@token.surfaceRaised" }, "members": [{ "type": "workspaces" }] },
  "clock": { "style": { "background": "@token.accent" }, "members": [{ "type": "clock" }] },
  "status": { "style": { "background": "@token.surfaceRaised" }, "members": [{ "type": "battery" }, { "type": "network" }] }
}
  • The membership comes with the theme: switch to another theme and the widgets leave its groups. Nobody needs empty groups entries.
  • A widget's own group, whether set in the main file, an include or a profile, always wins, and there's a way to keep one widget out of a theme's group.
  • Theme membership never stops a configuration from loading. Members must share a position today ("Widgets in group … must share a position"), so a matching widget in another position stays out.
  • As with any group, members gather where the first one appears, so choosing the theme can move a widget next to the group's other members within its position. Positions and the order of groups stay the user's.
  • Selectors stay narrow: built-in type and role, matching every key listed. Script, provider and package widgets have no type that says what they show, so they still join with group.
  • Settings shows a widget the theme placed as part of its group.

members is a new key under groups, so the change is additive, and older builds skip it with a warning (Files from a newer StableBar). As a configuration change it needs a maintainer's OK. Which keys a selector may match and how a widget opts out are still open.

Possible today

Partly. Put a group on each widget and an empty entry in groups for each group, or, in the 0.16 betas, use a "when": { "theme": "<id>" } profile whose widgetOverrides set group on each widget by ID. Both have to be written by each person, widget by widget.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    enhancement
    on Nov 16, 2026
  2. 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

No one assigned

    Labels

    enhancementreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions