feat: choose OpenVPN Connect's logo color and fade it while disconnected

Merged
M4
7h ago
+56-24

Package

OpenVPN Connect 1.0.3. The bar shows OpenVPN Connect's logo in a color that suits the bar, on Notch too, and fades it while no profile is connected.

Changes

  • A Logo color setting: Automatic, Black or White. StableBar draws an image block as it is, without tinting, so the setting picks between OpenVPN Connect's black and white icon files. Automatic follows macOS's light or dark mode, read from AppleInterfaceStyle, and the widget subscribes to AppleInterfaceThemeChangedNotification to switch at once. This replaces the "OpenVPN Connect in dark mode" profile that 1.0.0 added: it no longer shows among people's profiles, and pinning a profile no longer leaves a dark bar with the black icon.
  • Notch. Its bar and popup are black in light and dark mode, so in light mode Automatic would draw the black icon on black. A package profile, "OpenVPN Connect on Notch" ("when": {"theme": "notch"}), sets the openvpnConnectBarShade token, which reaches the script as BAR_SHADE=dark, and Automatic then picks the white icons. Black or White chosen by hand still wins. Like any profile, it doesn't apply while another profile is pinned.
  • Faded while disconnected. The bar keeps the filled logo while no profile is connected and outputs the muted data state; the widget's states.muted.opacity is 0.5, since no built-in theme defines muted (Fern does, with the same 0.5). Connecting keeps OpenVPN Connect's own icon. The popup's rows keep an icon for each state and aren't faded.
  • minimumVersion 0.11.0 → 0.16.0. The theme profile condition arrived in 0.16.0, and older versions reject the package because of it. The index keeps 1.0.2 for them.

Access

scripts/status.sh now reads LOGO_COLOR and BAR_SHADE from its environment and, when Logo color is Automatic and no bar shade is set, runs defaults read -g AppleInterfaceStyle, which only reads macOS's appearance setting. scripts/control.sh is unchanged. No requires, permissions or hosts change.

Testing

  • scripts/check-package.sh passes with StableBar 0.18.0-beta, standing in for main, which I didn't build; with 0.17.0, the latest release; and with 0.16.0, the new minimumVersion. 0.15.0 refuses it only for the minimum version.
  • shellcheck, check-listing.sh, check-one-package.sh, check-versions.sh and test.sh pass.
  • Installed on a bar running StableBar 0.18.0-beta with the Fern theme, macOS in dark mode, and OpenVPN Connect 3.9.1 with no profile connected: the widget runs without errors, gets LOGO_COLOR=Automatic and an empty BAR_SHADE, shows the white logo and outputs muted.
  • In StableBar's source, matching profiles merge before tokens are substituted across the configuration, so the Notch profile's token reaches the widget's environment; and a widget's data state sets its opacity once, not again on its image block.

Screenshots: drawn by StableBar 0.18.0-beta with --render-scenes. The widget's output is what status.sh printed for sample profiles with stubbed scutil, netstat and defaults, not a live VPN; the Notch scenes use the BAR_SHADE the profile sets. The clock is a plain text widget.

The bar with Logo color: Automatic, and Notch with each Logo color
Fern, and the SF Symbols fallback
The popup, connected
The popup while connecting, with nothing connected, and on Fern

Not checked: the Notch profile on a running bar, since the scenes take the script's output as given; and Automatic under macOS's Auto appearance after a switch while the Mac was off, when AppleInterfaceStyle can lag until the next switch.

Claude Opus 5.5 via Claude Code


Summary by cubic

Adds a Logo color setting to OpenVPN Connect and fades its bar logo while no profile is connected.

  • The setting picks between OpenVPN Connect's black and white icon files; Automatic follows macOS's light or dark mode and uses white on the Notch theme, whose bar stays black.
  • Replaces the "OpenVPN Connect in dark mode" profile, which no longer appears.
  • The bar keeps the filled logo while disconnected and fades it to 50% opacity.
  • Raises minimumVersion to 0.16.0, which the theme profile condition requires; older StableBar versions keep receiving 1.0.2.