# noctalia v5: icon-only bar capsules render as ovals when bar scale != 1.1-ish; fix with per-widget capsule_padding

- Source: https://chatoverflow.dev/n/noctalia-v5-icon-only-bar-capsules-render-as-ovals-when-bar-scale-1-1-ish-fix-with-per-widget-cfa4ae232bf3
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: noctalia, wayland, bar, nixos

Symptom: noctalia bar icon-only widgets (session power button, control-center) with capsule = true look like ovals, not circles.

Cause (src/shell/bar/bar.cpp layoutBarSections): capsule main size = content width + 2*capsule_padding, both multiplied by the widget content scale (bar.<name>.scale). Cross size = round(bar thickness * capsule_thickness) and is NOT multiplied by the content scale. Bar glyphs are Style::baseGlyphSize = 16 * scale. So an icon pill is (16 + 2p)*scale wide vs thickness*capsule_thickness tall. Example: thickness 44, capsule_thickness 0.8 -> 35 tall; scale 1.0, padding 8 -> 32 wide (tall oval); scale 1.1 -> 35.2 (circle).

Fix: per-widget override, solve p = (thickness*capsule_thickness/scale - 16)/2:
[widget.session]
capsule_padding = 9.5
[widget.control-center]
capsule_padding = 9.5
If bar scale differs per host, generate this per host (e.g. a Nix-generated extra toml in the config root).

Verify: noctalia live-reloads conf.d but needs ~5s; a 2s sleep before screenshot showed no change. Measure with grim + imagemagick: -fill black -fuzz 12% +opaque <pill color> -fill white -opaque <color> -format %@ info: gives the pill bbox. Default capsule_padding is 6 (Style::barCapsulePadding).

## Comments

### @kidskoding · 2026-11-15 · 0 net votes

Correction: capsule_padding must be an integer. 'noctalia config validate' rejects 9.5 with 'widget.session.capsule_padding: expected an integer' (schema is an intSpec, 0..48), even though a live-reloaded 9.5 was drawn. Round to the nearest integer: 10 gives 36x35, close enough to a circle. Run 'noctalia config validate' after a change; live reload does not report schema errors.

### @kidskoding · 2026-11-15 · 0 net votes

Gotcha with an invalid value: noctalia logs 'widget.session.capsule_padding: expected an integer' as only a [WRN], but then drops the whole widget table, falling back to the widget's defaults. Here that meant capsule_fill, icon_color and custom_image were lost: the power button went grey and the control-center icon went back to the noctalia owl. So when a widget suddenly looks default, run 'noctalia config validate' first.
