Skip to content

Match profiles to more situations, and make their conditions easier to set #810

Closed

Description

@Seb-GRAF

Problem

Profiles can't tell where the Mac is or what it's doing, and the conditions they have are hard to set.

Too few conditions. Profiles match appearance, onBattery, displayCount, externalDisplay, app and theme (ProfileConditions in Sources/StableBar/ThemeConfiguration.swift). externalDisplay says whether any monitor is connected, not which one, so a profile can't apply only at home with the home monitor and stay off at the office with another. Nothing matches sharing the screen, for example to hide personal widgets during a call.

Hard to set. + Condition in Settings → Profiles opens a flat menu of nine items (conditionItems in Sources/StableBar/ProfilesView.swift):

  • Opposites are separate items: Dark Mode / Light Mode, On battery / On power adapter, A monitor is connected / Only the laptop screen is connected. Each condition holds one value, so picking one silently replaces its opposite.
  • The screen count item names the current count, such as "1 screen is connected". Another count needs the stepper on its chip afterwards.
  • An app condition holds one app.
  • The menu doesn't mark which conditions are set, and nothing shows which ones are true right now, so it's hard to tell why a profile is or isn't active.
  • All conditions must match. There is no "any of" or "not".

Proposal

New conditions

Each with a coding key, a schema entry and an item in + Condition:

  1. A named monitor is connected: "display": "LG HDR 4K", matched against NSScreen.localizedName. + Condition lists the connected monitors by name. Open question: match by name, or by vendor, model and serial number (CGDisplayVendorNumber, CGDisplayModelNumber, CGDisplaySerialNumber) to tell two identical monitors apart.
  2. On a Wi-Fi network: "wifi": "Home", from the network name the wifi provider already reads. macOS gives it only with Location access, which the wifi provider already asks for; without it, the condition never matches.
  3. In a call: "camera": true or "microphone": true, from what the privacy provider already watches, without a permission.
  4. Sharing the screen: macOS has no public API that tells an app its screen is being captured. A private call would go in PrivateAPI.swift and needs a maintainer's OK.
  5. Maybe: the connection type (wifi, ethernet, offline) from the network provider, as a sign of being docked.

Each condition must update the active profiles when it changes, as appearance, power, screens and the focused app do through SystemContext (Sources/StableBar/SystemContext.swift).

An easier editor

  1. Group the menu under headings (Appearance, Power, Screens, Apps, Theme) and offer each kind once. Choose the value on the chip: Power: on battery ▾ switches to on power adapter, Screens: 2 ▾ picks a count, Monitor: LG HDR 4K ▾ picks a connected monitor.
  2. Mark each chip with whether it matches now, and name the condition that keeps an inactive profile off.
  3. Let an app condition list several apps. app would also accept an array, an additive configuration change.
  4. Open question for a maintainer: "any of" and "not" need a configuration change.

The layout is a matter of taste: two or three renders for the maintainer to pick from.

Possible today

Partly:

  • externalDisplay and displayCount match any monitor, or a number of screens.
  • Screen setups give each combination of screen kinds (laptop, landscape monitor, vertical monitor) its own bar, not each monitor.
  • StableBar --profile NAME from a Shortcuts automation, which can start on a Wi-Fi network on macOS 26, pins one profile and replaces automatic matching.
  • Edit as JSON… edits when directly, with the same limits as the menu.

Related

Triaged by Claude Code via T3 Code (Claude Opus 5.5).

Activity

  1. added
    enhancement
    on Nov 18, 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