Skip to content

Bar pills: an optional background per widget or run of widgets - #13139

Open
cristian-fleischer wants to merge 11 commits into
omacom:quattrofrom
cristian-fleischer:bar/3-pills
Open

cristian-fleischer wants to merge 11 commits into
omacom:quattrofrom
cristian-fleischer:bar/3-pills

Conversation

@cristian-fleischer

@cristian-fleischer cristian-fleischer commented Sep 24, 2026 •

Copy link
Copy Markdown

Pills give widgets their own background, so the bar can go clear (omarchy bar background none) and the widgets still sit on something, or turn into frosted glass pills with glassy. Off by default.

Rebased onto the reworked bar (#15517) and the full-screen bar window (#6782). It no longer needs #13137: the pill size keys go into the [bar] allowlist from 201de1c.

Pill modes on the clear, glassy and opaque bar

Rounded corners, on a floating bar (#13138):

Pill modes on a floating bar, rounded corners

How it works

  • bar.pills in shell.json: section joins neighboring widgets into one pill, widget gives each its own, off draws none. A theme can set a default with [bar] pills; shell.json wins.
  • Each section list has its own pills: left, centerBegin, center, centerEnd and right. The tray's drawer gets none.
  • A spacer (even at "size": 0) or a change of "group" between neighbors ends a run. "pill": false keeps an entry off pills.
  • The run logic is a port of DankMaterialShell's SegmentRoles, as pure JS in BarModel.js. A widget that hides drops out of its pill without breaking the run or rebuilding the bar.
  • The first slot of a pill draws the whole pill. Per-slot segments meet at fractional pixels on scaled outputs and leave a visible seam on a translucent pill.
  • Text is picked for contrast against the pill. A translucent pill on a clear bar goes through omarchy-bar-text-color --blend, which composites the pill over each wallpaper sample before the contrast and mist checks from Add soft mist behind clear bar on low-contrast wallpapers #20671.
  • Opaque pills already give every widget a background, so the clear bar's mist stays off behind them.
  • The bar background sets the pill look. On an opaque bar a pill in the bar's own color would be invisible, so it defaults to the bar text at 10% over the bar. On a clear bar it is the bar color. On a glassy bar the strip is not drawn and the pills take its glass (the pill color at no more than 35% opacity), so the blur Omarchy already turns on for a glassy bar falls on the pills alone: frosted pills with no new setting.
  • "pill": false widgets use the pill text color, and a bare widget at a section end keeps the stock end margin.
  • Tray icons on the bar follow the pill text color. The tray popups sit on the popup background and keep the theme text. Widgets outside the shell see bar.pillsOn, so a cloned tray does the same.
  • An odd pill-gap splits so neighboring pills are exactly pill-gap apart. pill-gap and pill-padding accept 0.
  • Dragging the first widget of a pill keeps the pill under its neighbors, the drag ghost stays under the pointer and sits on the pill color, and no empty pill stays behind once the widget's room moves away or the widget is pulled off the bar. The room a drag opens joins the pills as the dragged widget, with the padding it keeps, so a dropped widget lands where its room showed it.
  • The omarchy agent skill gets a Bar Pills section in shell.md, and a Layer Rules section in hyprland.md: frosted pills come from glassy, and blur behind translucent pills on a clear bar is a layer rule with ignore_alpha.

Theme keys

All optional, all in [bar], with commented examples in shell.toml.tpl: pills, pill, pill-alpha, pill-text, pill-border, pill-border-alpha, pill-radius, pill-inset, pill-padding, pill-gap. Unset, pills use the bar's colors and Hyprland's rounding.

This is an alternative to #7251 by @Saco93. It takes #7251's border and theme-template examples (credited as co-author) and draws pills per widget run instead of wrapping each section in a container. That keeps per-widget hover, lets hidden widgets drop out, and avoids re-parenting the section lists.

Unchanged unless enabled

With pills unset or off, the bar renders as on quattro at all four positions, opaque and clear background, clock included. 0 differing pixels, apart from an occasional 1 of 255 on one edge pixel of the weather icon. quattro shows the same pixel against an identical copy of itself, so it is render noise from the distance-field icons (#17003), not this PR.

Tests

bar-test.sh: cases for modes, runs, spacer and group splits, hidden widgets, section end margins and odd gaps, and the contrast helpers. #19904 dropped bar-text-color-test.sh, so bar-test.sh has a --blend case next to #20671's sampler cases instead. The bar-drag fixture drops a widget at a pill's end in widget and section mode and checks it lands where its room showed it. After the rebase onto #6782, checked again in a nested Hyprland: section pills on an opaque and a clear top bar, frosted widget pills on a glassy top and left bar. The GIFs are built from screenshots in the same setup.


Part of a set of opt-in bar changes described in #13136: #13137 [bar] size keys, #13138 floating, #13139 pills, #13140 bar options. Nothing changes unless you turn it on.

Claude (Anthropic) wrote most of this under my supervision; I reviewed it and run it on my own Omarchy install.

@llstrk

llstrk commented Sep 24, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Verified: the pill run logic, the new theme keys and the --blend text-colour sampler behave as described. The PR's JS assertions and bar-text-color-test.sh pass on this head and fail on the base. One exception to "unchanged unless enabled" was found in source: with pills off, the anchored centre widget (the clock) can move by 1 px. With pills on, a few colour and layout gaps remain, mostly around "pill": false.

Pills off: the anchored centre widget can move 1 px

shell/plugins/bar/Bar.qml:1671 and :1726 replace anchors.centerIn: parent with Math.round((P - (s - pillLead - pillTrail)) / 2) - pillLead. The comment above them says this equals anchors.centerIn without pills. Qt's centerIn (qquickanchors.cpp, with the default alignWhenCentered) rounds each half separately: qRound(P/2) - qRound(s/2). The two results differ by 1 whenever the parent size is even and the widget size is odd.

The stock vertical clock is 3 lines × icon-slot 27 = 81 px tall, so a left or right bar on an even-height output hits this case:

left/right bar, output height P = 1080, stock vertical clock s = 81, pills unset

base  anchors.centerIn     qRound(1080/2) - qRound(81/2)  = 540 - 41 = 499
head  Math.round((P-s)/2)  Math.round(999/2)              = 500

The clock and the centre widgets anchored to it sit 1 px lower. On horizontal bars the same shift happens only when the clock width is an odd integer, which is not the typical case.

Impact: small, but it contradicts the "0 differing pixels at all four positions" claim for left and right bars at the default font size. This comes from source and Qt's anchor code; no screenshot diff was taken.

Suggested change: x: Math.round(parent.width / 2) - Math.round((width - pillLead - pillTrail) / 2) - pillLead (and the y equivalent). This reproduces centerIn exactly with pills off and keeps the anchor fixed when roles change.

"pill": false widgets and tray icons do not get their own text colour

With pills on, barForeground becomes the pill text colour for the whole bar (Bar.qml:102-104). The tray's symbolic icons, however, read bar.foreground, which stays on the theme text colour (widgets/Tray.qml:19, Bar.qml:77):

bar.barForeground (pill-aware) -> every WidgetButton, ActiveWindow, media,
                                  including widgets with "pill": false
bar.foreground (theme text)    -> tray symbolic icons (MultiEffect colorization)
  • A "pill": false widget sits on the bar or the wallpaper, not on a pill, yet uses the colour picked for the pill. Example: the README layout (transparent: true, section pills, omarchy.power with "pill": false) over a light wallpaper. The default opaque pill keeps light text, so the bare power widget gets light text on the light wallpaper. Without pills the sampler would pick dark text there.
  • A theme with a [bar] pill-text that differs from [bar] text, or a light [bar] pill on a dark theme, flips widget text and the tray chevron. The symbolic tray icons keep the theme text colour, so they can end up light on a light pill.

Impact: low-contrast text or icons in these theme and wallpaper combinations. Stock themes with default pill colours are mostly unaffected. This comes from the source; it was not observed on screen.

Suggested change: choose the foreground per slot (the pill colour for slots with a pill role, the pre-pill colour for role none), and have the tray use the pill-aware colour for its bar-facing icons. If per-slot colour is out of scope, document that "pill": false widgets share the pill's text colour.

Pills on: a bare widget at a section end overhangs the bar

sectionEndMargin is pillInset - Math.round(pillGap / 2) (Bar.qml:110), which is 2 − 3 = −1 px at defaults. Pill slots make up for this with their own end padding, but a "pill": false widget at the outer end of a left or right section has none. It moves from 8 px inside the bar edge to 1 px past it, and further with a larger pill-gap.

Impact: a "pill": false widget at the outer end of a section extends past the bar edge, which matches the README's example layout. This comes from source; it was not observed on screen.

Suggested change: keep Style.space(8) for an end slot whose role is none, or compute the margin from the outermost drawn slot's role.

Pills on: dragging the first widget of a pill covers the rest of it

The run's pill rectangle is a child of its first slot, and a dragged slot gets z: 100 (Bar.qml:1946). While that first widget is dragged in a left, right or unanchored centre section, its pill paints over the other widgets in the same pill.

Impact: during the drag, the other widgets in that pill are hidden when the pill is opaque, or tinted when it is translucent. This comes from Qt's paint order; it was not observed on screen.

Suggested change: draw the pills in a layer behind the row or column, or skip the z raise for a slot that owns a multi-widget pill.

Documentation: docs/omarchy-shell.md:389 points to omarchy bar pills section, but bin/omarchy-bar has no pills command at this head (#13140 adds it). The layer-rules link in default/agents/skills/omarchy/hyprland.md returns 404; the current page is https://wiki.hypr.land/configuring/core/rules/layer-rules/. The hl.layer_rule snippet itself matches the Hyprland 0.56 Lua bindings.


Review information

Test scope: source review of head 2b60e70 against base 28ceaae, including Qt Quick anchor and positioner source, DankMaterialShell SegmentRoles.js and the Hyprland 0.56 Lua rule bindings. The PR's JS assertions, bar-text-color-test.sh and extra edge cases ran in an isolated sandbox, with the base as a negative control. The JS ran under Deno's Node compatibility because Node was not available there. Nothing was rendered: all visual effects above come from source, not screenshots.

AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, with targeted cross-checks of each other's findings, and an Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@cristian-fleischer

Copy link
Copy Markdown
Author

Thanks @llstrk, all confirmed.

  • Anchor: you were right. My screenshot diff masked the clock, so it missed this. The anchor now uses round(P/2) - round(s/2), which matched anchors.centerIn on all 10,000 size pairs I tried in Qt 6.11. The diff no longer masks the clock: the old code shows the shift on a left bar, and the new one gives 0 pixels at all four positions.
  • A bare widget at a section end keeps the stock 8 px end margin.
  • Tray icons follow the pill text colour while pills are on.
  • "pill": false colour: I documented that bare widgets share the pill text colour. A colour per slot touches a lot of code for a rare setup, so I'd leave it until someone needs it.
  • Drag z-order: left as is. It only shows during a drag, and the clean fix is a separate pill layer behind the row. Happy to do it if the maintainers want it.
  • Docs: dropped the omarchy bar pills reference (it comes with Bar options: right-click menu, omarchy bar pills|floating, menu rows #13140) and fixed the layer-rules link.

@llstrk

llstrk commented Sep 27, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Follow-up to the earlier review and the author's reply, checked at head dbf89bf.

Verified: the anchor, section-end margin and documentation fixes work as described. The drag z-order is unchanged, as the reply says it would be. The tray colour fix has one side effect: the tray's popup menus now take the pill text colour too (new finding below).

Earlier finding At dbf89bf
Pills off: anchored centre widget moves 1 px Resolved. BarModel.anchorOffset computes round(P/2) - round(s/2), which is how anchors.centerIn rounds in Qt's qquickanchors.cpp (identical in 6.10.3, 6.11.2 and 6.12.0-rc1). It matches a qRound model on about 2.77 M size pairs, fractional sizes included (1080/81 now gives 499, as Qt does). With pills on, the widget content stays on the same pixel for every role.
"pill": false widgets and tray icons colour Resolved as scoped. The tray's bar icons follow the pill text colour. Bare widgets keep the pill text colour, now documented in docs/omarchy-shell.md and the bar README.
Bare widget at a section end overhangs the bar Resolved. A bare outer widget sits 8 px from the bar end again, and an outer pill still sits pill-inset from it (also with an odd pill-gap and with pill-inset = 0).
Dragging a pill's first widget covers the rest Still present, deliberately deferred. Bar.qml still gives the dragged slot z: 100 while it draws the run's pill.
omarchy bar pills reference, layer-rules 404 Resolved. The reference is gone, and the new wiki link resolves and documents the same hl.layer_rule syntax as the snippet.

With pills on, the tray's popup menus use the pill text colour

shell/plugins/bar/widgets/Tray.qml:21 changes the tray's whole foreground property to the pill-aware colour. That property colours the bar icons (line 796), and also both tray popups:

  • the tray-management popup: header, item names, Pin/Hide buttons (lines 416-506);
  • a tray item's right-click menu: border, row text, hover fills, check mark, submenu glyph (lines 537-738).

Both popups are PopupCards drawn on Color.popups.background (shell/Ui/PopupCard.qml:153), not on a pill. The other bar panels colour their popup content with bar.foreground, and the tray did too at the previous head.

pill text picker ─┬─ bar text               (usual case)
                  └─ Color.background       (light pill on a dark theme, and similar)
                                │
Tray.foreground ────────────────┤── bar icons         on the pill    OK
                                └── popup text/border on the popup card
                                                      = [popups] background = {{ background }}

Computed with the head's colour helpers:

Theme and pill setup Tray popup text Popup card Contrast (theme text before)
Tokyo Night, "pills": "section" only #a9b1d6 #1a1b26 8.1 (8.1)
Tokyo Night, [bar] pill = "{{ foreground }}" #1a1b26 #1a1b26 1.0 (8.1)
Tokyo Night, [bar] pill-text = "{{ background }}" #1a1b26 #1a1b26 1.0 (8.1)
Catppuccin Latte, [bar] pill = "{{ foreground }}" #eff1f5 #eff1f5 1.0 (7.06)

The same flip can come from a translucent pill on a transparent bar over a light wallpaper. In a sandbox run with Tokyo Night colours and a light test image, the head's omarchy-bar-text-color with --blend '#1a1b26' 0.5 returned #1a1b26; at the template's example alpha 0.85 it did not flip.

Impact: with pills on and a pill colour of the opposite lightness, a flipping translucent pill, or a pill-text close to the popup background, the tray's right-click menu and management popup become unreadable (with the stock popup colours, the text is exactly the popup background colour). Stock themes with only "pills": "section" are not affected. This comes from source and computed colours; it was not observed on screen.

Suggested change: keep foreground on bar.foreground for popup content, and give only the bar-facing tray icons the pill-aware colour, for example:

readonly property color foreground: bar ? bar.foreground : Color.foreground
readonly property color barIconColor: bar ? (bar.pillsOn ? bar.barForeground : bar.foreground) : Color.foreground
// TrayIcon colorizes with a `tint` property defaulting to root.foreground;
// the TrayItem on the bar sets tint: root.barIconColor.

No test covers the tray colour in either direction.

Verified: on this head, bar-test.sh (128 checks) and bar-text-color-test.sh (8 checks) pass. On the merge-base, the same tests fail at the icon-slot token and the first --blend case. The rewritten numeric-key test in the first commit runs the real Style.qml parser rather than matching its text. With pills off, colours, margins, slot geometry, the sampler arguments and the tray colour are the same as the base in source.


Review information

Test scope: source review of head dbf89bf against the previously reviewed 2b60e70 and the merge-base 28ceaae, including Qt's qquickanchors.cpp and the Hyprland layer-rules wiki page. The PR's tests and extra anchor, margin and colour cases ran in an isolated sandbox (the JS cases under Node), with the merge-base as a negative control. Nothing was rendered: the author's "0 differing pixels" result was not re-checked, and the popup contrast above is computed, not observed.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@cristian-fleischer

Copy link
Copy Markdown
Author

Thanks @llstrk, good catch, that one was mine. Tray.foreground is back on bar.foreground, so the popups keep the theme text. Only the tray icons on the bar take the pill colour, through a tint on TrayIcon. bar-test.sh checks both.

Another review pass found a few more things, also fixed:

  • Drag z-order after all: the first widget of a multi-widget pill no longer rises over the rest of the pill while dragged, and the drag ghost stays under the pointer inside a pill.
  • An odd pill-gap now splits so neighbouring pills are exactly pill-gap apart, and pill-gap and pill-padding accept 0.
  • On a transparent bar, a text colour refresh asked for while a pill sample runs is no longer dropped.
  • A cloned tray gets bar.pillsOn, so its icons follow the pill colour too. bar.barForeground and bar.pillsOn are in the widget docs, and the README example uses barForeground.

@llstrk

llstrk commented Oct 1, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: All seven earlier findings are resolved at e3d713c; one minor new issue: the drag ghost can hide the dragged widget on a contrasting pill.

Follows the second review and the author's reply.

Drag ghost hides the widget on a contrasting pill

With pills on, widgets use the pill text colour, but on a drawn bar the drag ghost is filled with the bar background. With [bar] pill = "{{ foreground }}" both are the same colour (contrast 1.00): the ghost is an empty box. Impact: drag feedback only; stock themes with just "pills": "section" are fine.

Suggested change: on a drawn bar, fill the ghost with the pill as drawn: root.pillsOn ? Qt.tint(root.background, root.pillFill) : root.background (not tested).

Reproducer (computation at e3d713c, not rendered)

N1: with a contrasting pill colour, the drag ghost draws the widget in its own fill colour

Kind: computation from source with the PR's own colour helpers (shell/plugins/bar/BarModel.js at e3d713c6). Not a rendering; not observed on screen.

Source facts used:

  • Bar.qml pillForeground (lines 96-101): with [bar] pill set and [bar] pill-text unset, widget text is BarModel.pickTextColor(bar text, theme background, pill blended over the bar background). On a drawn bar pillTextSampled is false, so barForeground is this pill text (lines 102-104), and WidgetButton and the tray's bar icons draw in it.
  • Bar.qml DragGhostPanel (lines 1478-1500): the ghost is grabToImage of the widget drawn over a BorderSurface whose color is root.background (Color.bar.background) on a drawn bar, at opacity 0.94, with a 1 px border in root.barForeground.

Run from the root of an omarchy checkout at e3d713c6:

// ghost-contrast.js
const path = require('path')
const bar = require(path.resolve(process.argv[2] || '.', 'shell/plugins/bar/BarModel.js'))

const themes = [
  // [name, colors.toml foreground, colors.toml background]
  ['Tokyo Night', '#a9b1d6', '#1a1b26'],
  ['Catppuccin Latte', '#4c4f69', '#eff1f5']
]
for (const [name, fg, bg] of themes) {
  // [bar] pill = "{{ foreground }}" on a drawn bar: pillRaised is false, so the
  // backdrop is the pill at alpha 1.
  const pill = bar.blendHex(fg, 1, bg)
  // pillForeground with [bar] pill-text unset.
  const pillText = bar.pickTextColor(fg, bg, pill)
  console.log(`${name}, [bar] pill = "{{ foreground }}"`)
  console.log(`  pill ${pill}, widget text ${pillText}, contrast on the pill ${bar.contrastRatio(pillText, pill).toFixed(2)}`)
  console.log(`  drag ghost fill ${bg}, contrast of the dragged widget on it ${bar.contrastRatio(pillText, bg).toFixed(2)}`)
}

node ghost-contrast.js (Node v26.7.0), actual output:

Tokyo Night, [bar] pill = "{{ foreground }}"
  pill #a9b1d6, widget text #1a1b26, contrast on the pill 8.10
  drag ghost fill #1a1b26, contrast of the dragged widget on it 1.00
Catppuccin Latte, [bar] pill = "{{ foreground }}"
  pill #4c4f69, widget text #eff1f5, contrast on the pill 7.06
  drag ghost fill #eff1f5, contrast of the dragged widget on it 1.00

The picked text is right for the pill (8.10 and 7.06), but the ghost fill is the bar background, which here equals the picked text, so the dragged widget's glyph and the ghost's 1 px border have the same colour as the ghost fill. With the stock template and only "pills": "section" (the raised default pill), the pill text stays the theme text and the ghost reads as before (8.1 on Tokyo Night, 7.06 on Catppuccin Latte).

Details

Earlier findings: the "pill": false colour is resolved as scoped (documented, not changed). The pills-off anchor shift, section-end overhang, docs reference and layer-rules link stay fixed after the amend. The drag z-order and the tray popup colour are fixed in this revision. The drag ghost issue above was not raised before; its code is unchanged since the first revision.

Verified:

  • bar-test.sh (148 checks) and bar-text-color-test.sh (8 checks) pass at e3d713c, and also with the PR diff applied to 324f0ba, the base at review time.
  • Neighbouring pills are exactly pill-gap apart for odd gaps. In the same model check, the previous revision put them one pixel further apart.
  • [bar] pill-gap = 0 and pill-padding = 0 read as 0, through the real Style.qml token functions.
  • The drag z-order matches Qt's paint order, the ghost offset matches the slot layout in Bar.qml, and the sampler re-run matches Quickshell v0.3.1's Process. None was observed on screen.
  • bar.pillsOn reaches the plugin facade, so a cloned tray's bar icons follow the pill text colour.

Related PR #13570: it uses the layout "group" key to draw ovals, while this PR uses it to split pill runs. With this PR's Bar.qml and BarModel.js rebased onto #13570's base, a three-way merge with #13570's head leaves 13 conflict blocks in Bar.qml and 1 in BarModel.js. These include ModuleSlot and the anchored-centre lists.

Optional test improvement: most new round-2 checks match source text. A mutant that draws each horizontal pill from the wrong gap half (1 px off for odd gaps) still passes all 148 checks. Adding barInsetToken to the functions the existing vm harness extracts from Style.qml would make the zero-token check behavioural.

T1 (test validity): the round-2 geometry checks pin source text, not geometry

Kind: mutation run of the PR's own test/shell.d/bar-test.sh at e3d713c6, in an isolated sandbox (Node v26.7.0). Not a product defect; a note on what the new tests can and cannot catch.

Mutant 1: pill drawn from the wrong gap half

One-line change in shell/plugins/bar/Bar.qml (the pill Rectangle inside ModuleSlot):

-      x: root.vertical ? inset : slot.pillGapLead
+      x: root.vertical ? inset : slot.pillGapTrail

With an odd pill-gap this moves every horizontal pill 1 px towards its end, so the outer pill no longer sits pill-inset from the bar start and the padding inside the pill becomes uneven.

bash test/shell.d/bar-test.sh on the mutated tree, actual result: exit 0, 148 of 148 ok lines, including:

ok - the gap halves of two neighbouring pills add up to pill-gap
ok - a pill is drawn between the two gap halves of its run
ok - pill-padding and pill-gap keep a deliberate 0
ok - dragging the first widget of a pill keeps the pill under its neighbours
ok - the drag ghost stays under the pointer inside a pill

The regex for "a pill is drawn between the two gap halves of its run" checks the width line, not x.

Mutant 2: the old symmetric split

 function pillGapLead(pillGap) {
-  return Math.floor(pillGap / 2)
+  return Math.round(pillGap / 2)
 }

Actual result: exit 1. The identity check passes, and the behavioural sectionEndMargin case catches it:

ok - the gap halves of two neighbouring pills add up to pill-gap
ok - an even gap splits evenly
expected: -1
actual:   -2
not ok - the start of a section takes the smaller half of an odd gap

bar.pillGapLead(7) + (7 - bar.pillGapLead(7)) === 7 holds for any return value, so that assertion cannot fail; the odd-gap split is covered by the sectionEndMargin cases instead.

A behavioural alternative already fits the file's style: the test runs Style.qml's real barToken through vm, and the same harness can call barInsetToken('pill-gap', 6) with [bar] pill-gap = 0 (0 at e3d713c6, 6 with the previous barToken reader).


Review information

Test scope: source and sandbox tests at e3d713c; nothing was rendered, so drag and colour effects are computed from source.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@cristian-fleischer

Copy link
Copy Markdown
Author

Thanks @llstrk, fixed. While pills are on, the drag ghost now sits on the pill as drawn: the pill over the bar colour on a drawn bar, the pill alone on a transparent bar. Without pills it is unchanged.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge, with a non-blocking text-legibility issue after certain widget reorders.

Summary

The PR adds opt-in backgrounds for individual bar widgets or widget runs, with theme controls, wallpaper-aware text contrast, drag spacing, tray icon coloring, documentation, and tests.

  • Clear and glassy bars can draw pills without drawing a full background strip.
  • A position-only widget reorder can leave the new wallpaper-span check stale.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Bar layout and visible widgets] --> B[Widget spans]
  B --> C[Wallpaper contrast sampler]
  D[Theme and pill colors] --> C
  C --> E[Bar text color and mist]
  A --> F[Pill run roles and spacing]
  F --> G[Widget backgrounds]
Loading

Reviews (22) · Last reviewed commit: "Merge remote-tracking branch 'origin/qua..." · Reviewed by Greptile

Comment thread shell/plugins/bar/Bar.qml Resolved
Comment thread shell/Commons/Style.qml Resolved
@jandrusk

jandrusk commented Oct 8, 2026

Copy link
Copy Markdown

Heads-up for the rebase: #14553 (merged today) qualifies palette references as Commons.Color, because Qt 6.12's QtQuick Color type shadows the bare singleton. This PR adds about 11 bare Color. references in shell/plugins/bar/Bar.qml (Color.pick("bar.pills", ""), Color.bar.pill.a, …) and one in widgets/Tray.qml. They'll need to become Commons.Color.… or pills will resolve to undefined colors on Qt 6.12. The same applies to #13140, which carries these hunks.

@cristian-fleischer

Copy link
Copy Markdown
Author

Thanks for the heads-up @jandrusk. I'll switch these to Commons.Color in the port onto the reworked bar.

@cristian-fleischer

Copy link
Copy Markdown
Author

Rebased onto the bar rework (#15517). Section pills are now per section list (left, centerBegin, center, centerEnd, right), the tray drawer gets none, and the PR no longer needs #13137.

@cristian-fleischer

cristian-fleischer commented Oct 16, 2026 •

Copy link
Copy Markdown
Author

Added frosted pills: with pills on, glassy now draws no strip and the pills take the glass, so the blur Omarchy already turns on for a glassy bar sits behind the pills only. No new setting. If you'd rather keep glassy as the strip with raised pills on top, it's a one-line revert. GIFs are updated, with square and rounded corners.

Comment thread shell/plugins/bar/Bar.qml Resolved
@omarchybot omarchybot removed the enhancement New feature or request label Oct 16, 2026
@omarchybot omarchybot added the enhancement New feature or request label Oct 21, 2026
Comment thread test/shell.d/bar-test.sh Resolved
@cristian-fleischer
cristian-fleischer force-pushed the bar/3-pills branch 2 times, most recently from ba02afb to ce12a63 Compare October 29, 2026 11:34
Comment thread shell/plugins/bar/Bar.qml Resolved
@cristian-fleischer
cristian-fleischer force-pushed the bar/3-pills branch 2 times, most recently from 2de5042 to d656367 Compare November 2, 2026 10:22
Comment thread shell/plugins/bar/Bar.qml Resolved
Comment thread shell/Ui/KeyboardPanel.qml Resolved
cristian-fleischer and others added 4 commits November 19, 2026 10:07
bar.pills in shell.json (off, section, widget), or [bar] pills as a theme
default, gives widgets their own background so the bar background can be
switched off. Off by default: without it the bar renders as before.

- section joins neighbouring widgets into one pill; a spacer, even at
  size 0, or a change of "group" between neighbours ends it. widget gives
  every widget its own. "pill": false keeps an entry off pills.
- Roles are a port of DMS's SegmentRoles: hidden widgets drop out of a
  run without breaking it, so a widget that hides needs no rebuild.
- The first slot of a pill draws the whole pill. Per-slot segments meet
  at fractional pixels on scaled outputs and show a seam.
- Text is picked against the pill; omarchy-bar-text-color --blend
  composites a translucent pill over the sampled strip.
- On an opaque bar the pill is the bar text at 10% so it shows; on a
  clear bar it is the bar colour. On a glassy bar the pills take the
  glass and the strip is not drawn, so Omarchy's blur falls on the pills
  alone. A theme's [bar] pill wins.
- Theme keys: pill, pill-alpha, pill-text, pill-border(-alpha),
  pill-radius, pill-inset, pill-padding, pill-gap, all optional, with
  commented examples in the theme template.
- Every section list draws its own pills, so centerBegin, center and
  centerEnd each get theirs. The tray's drawer sits inside the tray's
  pill and draws none. The pill size keys join the [bar] allowlist.
- A bare widget at a section end keeps the stock end margin.
- Tray icons on the bar follow the pill text colour; the tray popups sit
  on the popup background and keep the theme text. Bar widgets outside
  the shell see bar.pillsOn, so a cloned tray does the same.
- An odd pill-gap splits so that neighbouring pills are exactly pill-gap
  apart, and pill-gap and pill-padding keep a deliberate 0.
- Dragging the first widget of a pill keeps the pill under its
  neighbours, and the drag ghost stays under the pointer and sits on
  the pill colour, so it shows in the pill text colour. Once the
  dragged widget's room moves away, no empty pill stays behind.
- The omarchy agent skill explains pills and their theme keys
  (plugins.md), and blur behind pills on a clear bar as a layer rule
  with ignore_alpha (hyprland.md).

Border and theme-template examples after omacom#7251.

Co-Authored-By: Saco Song <threesking@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Slots sit at the top of a horizontal section, so a pill centered on its
first slot sat high when that widget was shorter than the bar: a 16 px
widget lifted the pill by 5 px and clipped it at the bar's edge. The
pill now measures across the section, which is centered in the bar. A
vertical bar's pill takes the section's width the same way, so a narrow
first widget no longer narrows the pill for the rest of the run. Stock
widgets are all bar-sized and render as before.

Co-Authored-By: Claude <noreply@anthropic.com>
A refresh that came in while omarchy-bar-text-color was still sampling
was dropped unless pills were involved. Moving the bar or switching
floating on a clear bar mid-sample left the text color picked for the old
strip until something else asked again. Every such refresh now runs once
the current sample is in.

Co-Authored-By: Claude <noreply@anthropic.com>
A widget pulled off the bar keeps its layout entry until its poof has
played, about 620 ms. Its slot already closes (alongLength is 0), but it
still counted as drawn, so in widget mode an empty pill and its padding
stayed behind for the length of the poof. A slot pending removal now
leaves its pill at once.

Co-Authored-By: Claude <noreply@anthropic.com>
@omarchybot omarchybot removed the enhancement New feature or request label Nov 19, 2026
The omarchy skill's plugins.md became shell.md upstream (c80308f), so
the Bar Pills section moves there, after Bar Layout.
@omarchybot omarchybot added the enhancement New feature or request label Nov 22, 2026
Comment thread shell/plugins/bar/Bar.qml Resolved
The room a drag opened sat outside the pill run, so it held only the
widget's own length. Once the widget landed, its slot gained the pill
padding and the widget moved on by that much after the glide: 7 px with
the default pill settings in widget mode.

The room now takes part in its list's pills as the dragged widget. It gets
the padding the widget will have there, draws the pill when it starts one,
and the glide lands past the padding.
cristian-fleischer added a commit to cristian-fleischer/okimarchy that referenced this pull request Nov 29, 2026
The settle watchdog finishes any settle within 500 ms, so the floating
steps of the bar-drag fixture wait 700 ms instead of 1200 ms. That keeps
the fixture well inside its 15 s limit with the pill drop steps from
omacom#13139 added to it.
cristian-fleischer added a commit to cristian-fleischer/okimarchy that referenced this pull request Nov 29, 2026
The settle watchdog finishes any settle within 500 ms, so the floating
steps of the bar-drag fixture wait 700 ms instead of 1200 ms. That keeps
the fixture well inside its 15 s limit with the pill drop steps from
omacom#13139 added to it.
# Conflicts:
#	shell/plugins/bar/Bar.qml
# Conflicts:
#	bin/omarchy-bar-text-color
#	shell/plugins/bar/Bar.qml
@greptile-apps

greptile-apps Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings could not be posted inline.

  • P2 Widget spans stay stale shell/plugins/bar/Bar.qml:1655 ▶

    On a clear bar, reordering existing widgets around a spacer can move them without changing their sizes or adding a slot. The span refresh does not listen for position changes, so the wallpaper sampler keeps checking their old locations. A busy patch newly behind a widget can remain without the mist intended to keep its text legible.

@cristian-fleischer

Copy link
Copy Markdown
Author

The stale spans note is upstream code too: widgetSpans() and its refresh timer come from #21089 (widget spans) with the quattro merge, and this PR does not change them (git diff origin/quattro... is empty for that part of Bar.qml).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants