Skip to content

Keep settings tuned for one theme from applying under every other theme #666

Closed
1 of 1 issue completed

Description

@M4n0x

Problem

A theme can't hold everything its look needs. A theme may contain only tokens, defaults, popupDefaults, roles, workspaceDefaults, bar, groups and profiles (validateThemeDocument in Sources/StableBar/WidgetPackage.swift), so the rest of the look goes in the main file:

  • widget paddings sized for the theme's pills
  • a clock drawn as an accent chip
  • a filled slider style
  • an Apple menu symbol
  • a package widget's layout in widgetOverrides
  • empty groups entries, needed only because a widget in a group the theme doesn't define fails the whole configuration ("Unknown group" in Sources/StableBar/Configuration.swift)

Those values apply under every theme. Switch from Fern to Nord and the clock is still an @token.accent chip, and the widgets keep paddings meant for pills. Theme lists the values below the gallery, and Reset them deletes them, so going back to Fern means doing the work again.

Profiles can't help: they match appearance, onBattery, displayCount, externalDisplay and app (ProfileConditions in Sources/StableBar/ThemeConfiguration.swift), not the theme.

Proposal

  1. A theme profile condition that matches the selected theme's ID, at any version, with "built-in" for Built-in:

    "profiles": [
      {
        "name": "Fern",
        "when": { "theme": "fern" },
        "configuration": {
          "widgetOverrides": {
            "date": { "group": "clock", "background": "@token.accent" },
            "battery": { "group": "status", "style": { "paddingHorizontal": 12 } }
          },
          "groups": { "clock": { "style": { "paddingLeading": 3 } } }
        }
      }
    ]

    composeFiles in Sources/StableBar/ConfigurationLoader.swift settles the theme before profiles apply, including a screen setup's own theme and the theme Try Themes shows, so the condition reads that theme and a profile can't change it in a loop. Group memberships can move into the profile too, so the main file no longer needs empty groups. Versions that don't know the condition never match it (Files from a newer StableBar), so the profile just stays off there.

  2. Settings → Profiles → + Condition offers Theme, listing the built-in and installed themes.

  3. At the top of Theme and in a widget's Style tab, a scope switch: Every theme or Only with Fern. With Only with Fern, changes save into a profile with that condition, created on first use, the way Edit the bar for this profile saves into a profile today.

  4. When the main file overrides the theme, Theme's notice offers to keep those values with a theme as well as Reset them: it moves them into that theme's profile in one undoable change.

The exact wording and placement of the switch and the notice are a matter of taste; renders of a few options can follow in a comment.

Possible today

Partly. Put the settings in a profile without when and turn it off with "enabled": false when switching theme, or pin it with "profile" or StableBar --profile. Pinning turns off automatic matching for every other profile, and nothing ties either way to the theme.

Related

Triaged by Claude Code (Claude Opus 5.5).

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    enhancement
    on Nov 15, 2026
  2. M4n0x commented on Nov 22, 2026

    @M4n0x
    CollaboratorAuthor

    This got done in #697 (0.16.0) and #861 (0.18.0), edits to the look now stay with their theme and Keep with … Only moves the old ones there, so closing

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions