Skip to content

Let [bar] in shell.toml set every token Style reads - #6587

Open
tmn73 wants to merge 3 commits into
omacom:quattrofrom
tmn73:allow-bar-token-overrides
Open

tmn73 wants to merge 3 commits into
omacom:quattrofrom
tmn73:allow-bar-token-overrides

Conversation

@tmn73

@tmn73 tmn73 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What's wrong

Style.qml reads six [bar] tokens:

readonly property int sizeHorizontal: root.barToken("size-horizontal", 26)
readonly property int sizeVertical:   root.barToken("size-vertical",   28)
readonly property int iconSlot:       root.barToken("icon-slot",       27)
readonly property int iconCanvas:     root.barToken("icon-canvas",     16)
readonly property int iconFont:       root.barToken("icon-font",       13)
readonly property int statusSlot:     root.barToken("status-slot",     21)

applyShellValues() writes only two of them into barOverrides:

} else if (section === "bar") {
  if (key === "scale-with-font") {
    nextBarScaleWithFont = boolToken(raw, nextBarScaleWithFont)
  } else if (key === "size-horizontal" || key === "size-vertical") {
    var b = parseInt(raw, 10)
    if (isFinite(b)) barOut[key] = b
  }
}

So icon-slot, icon-canvas, icon-font and status-slot are parsed and dropped. Nothing can set them: not ~/.config/omarchy/shell.toml, and not a theme either, since themes go through the same function. Those four barToken lookups can only ever return their fallback.

It is silent, too. An unrecognised key produces no warning, so a [bar] block that does nothing looks like one that works.

The fix

Let the [bar] branch pass unknown numeric keys through, which is what [font] and [spacing] already do:

} else if (section === "font") {
  ...
  else fontOut[key] = ival

One line. No new tokens, no behaviour change unless someone sets a key that was previously ignored.

On whether you want this at all

I am not sure this is the fix you want, so say the word and I will close it.

The defect is real either way: four properties are unreachable from any configuration. But there are two reasonable directions and it is your call which one:

  1. Open the keys, as here.
  2. Delete the four dead lookups, if bar icon sizing is deliberately not user-tunable.

I went with 1 because size-horizontal and size-vertical are already tunable, so bar geometry is not sealed off in principle, and because [font] and [spacing] accept any key. If the intent is that only bar dimensions are configurable and glyph sizing is not, 2 is the right patch and this one should go.

For what it is worth, the reason I found this: the weather glyph reads much smaller than its neighbours, since the weather icons are U+E3xx (legacy Weather Icons) while bluetooth and friends are U+F0Bxx (Material Design Icons), which fill their em box far more. That is a font design difference no global token can even out, and #5712 is the same complaint from the waybar era. Being able to set status-slot and icon-font is a partial workaround, not a fix for that, and I am not proposing one here.

Testing

New test/shell.d/shell-token-overrides-test.sh asserts the invariant rather than the patch: every token barToken() reads must be writable by applyShellValues. It passes on this branch and fails on quattro, and it would catch the same class of mistake for any token added later.

Verified in the running shell: with the patch, [bar] icon-font = 18 in ~/.config/omarchy/shell.toml changes the bar glyphs after omarchy-restart-shell, and without it the same block does nothing.

Style.qml reads six [bar] tokens through barToken(), but applyShellValues() only
writes size-horizontal and size-vertical into barOverrides. icon-slot,
icon-canvas, icon-font and status-slot are parsed and dropped, so nothing can set
them: not a user shell.toml, and not a theme either, since themes go through the
same function. Those four lookups can only return their fallback, and an
unrecognised key produces no warning, so a [bar] block that does nothing looks
like one that works.

Pass unknown numeric keys through, the way [font] and [spacing] already do.
Copilot AI balanced review requested due to automatic review settings August 6, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
The token list came from a pattern that only matched barToken("x") with no space after the parenthesis, and an empty list made the loop run zero times and pass. With the calls written barToken( "x" ) the test passed even with the whitelist restored. Collect the tokens whitespace-tolerantly first and fail if there are none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and reproduced on an Omarchy worker VM. The bug is real and the fix works. #13137 makes the same change and is the one I'd suggest landing, so this is waiting on the maintainer to choose between the two.

Reproduction. A [bar] block setting all six tokens, parsed by Color.parseShell and applied through Style.applyShellValues, leaves icon-slot, icon-canvas, icon-font and status-slot at their fallbacks (27/16/13/21) on quattro while size-horizontal takes effect. On this branch all six take the configured values. With the one-line change in shell/Commons/Style.qml reverted, they drop back to the fallbacks. ./test/cli and every test/shell.d file give the same results on this branch merged onto quattro as on quattro itself. The 8 files that fail there fail on quattro too and have nothing to do with the bar.

Pushed one commit (7375b1f). shell-token-overrides-test.sh extracted the tokens with a pattern that only matched barToken("x"). If the calls were written barToken( "x" ), the list came back empty, the loop ran zero times, and the test passed even with the whitelist restored; I confirmed that on the worker. It now collects the tokens whitespace-tolerantly and fails if it finds none. One gap is still open: because the test checks source text rather than behaviour, deleting the barOut[key] = b assignment would still pass. A runtime check would need require_compositor from a newer base-test.sh than this branch has, so I left that alone.

Competing fix. #13137 makes the identical Style.qml change. It also documents the four keys in docs/omarchy-shell.md and the theme template, and its test in test/shell.d/bar-test.sh runs the real applyShellValues and barToken and checks all six values, so it catches the case this test misses. Nothing in this PR's runtime change would be lost by taking that one instead. #11359 reports the same dropped keys along with a second problem (bar glyphs sized from typography tokens) that neither PR addresses, so I have not linked it as fixed.

Second opinion: Codex Medium, over two rounds. It found the test gap above and nothing wrong with the fix, and found nothing in the pushed commit. Asked separately which of the two PRs to prefer, it chose #13137 for the reasons above; it can read this session's working notes, so treat that as agreement rather than an independent verdict.

@cristian-fleischer

Copy link
Copy Markdown

Hi @tmn73, sorry, I missed this PR when I opened #13137, which makes the same fix. I've credited you in #13137's description. If the maintainers prefer to take this one, I'm happy to move the docs and the test over here.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 10, 2026
quattro added notch-height to the [bar] whitelist this branch removes. The branch's open else already stores notch-height, which Style.bar.notchHeight reads raw from barOverrides, so the resolution keeps the else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 10, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch had stopped merging cleanly, so I merged quattro into it and pushed the result as 9226c19. quattro had added notch-height to the same [bar] whitelist this PR removes. Your open else already stores notch-height, and Style.bar.notchHeight reads that key raw from barOverrides, so the merge keeps your line as it is. The bug is still present on current quattro.

Reproduction, on an Omarchy worker VM. I ran the real applyShellValues and barToken from shell/Commons/Style.qml on a [bar] block that sets all six tokens plus notch-height. On quattro, icon-slot, icon-canvas, icon-font and status-slot fall through to the minimum. On 9226c19 all six take the configured values and notch-height still arrives. With the one-line change reverted, the four drop out again. ./test/cli passes. The full test/shell.d run on the linked shell fails the same 20 files on this head as on quattro itself (72 failures in both runs, mostly node missing from the test environment). None of those files touch the bar or the tokens, and this head passes one more test than quattro: the token test this branch adds.

Which of the two PRs. In my earlier comment I suggested taking #13137 instead. I'm reversing that. Both PRs make the same runtime change, and the project's rule for competing fixes is that the first one keeps the credit unless the newer one fixes something the older misses. #13137 doesn't: it fixes no case this one leaves broken. What it does add is worth having here, though: a test in test/shell.d/bar-test.sh that runs the parser and checks the values, which also covers the gap I noted last time (deleting barOut[key] = b would still pass this branch's test, because it reads the source text), plus the four keys documented in docs/omarchy-shell.md and the theme template. @cristian-fleischer offered to bring those over, and that would complete this PR.

Second opinion: Codex Medium reviewed the merged tree and compared the two PRs. It found the merge resolution correct and the change proportionate, and chose this PR under the same rule. It also named the same test gap and the same parts of #13137 as worth folding in. It can read this session's working notes, so take that as agreement, not an independent verdict.

This is verified at 9226c19 and waits on the maintainer. The repository runs no CI on it, so I haven't marked it ready.

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Allows shell configuration to set all bar styling tokens.

The parser change appears safe to merge, with a non-blocking improvement needed in the new test.

Findings

  1. P2 Test misses broken overrides ▶

Summary

Lets numeric [bar] settings reach every size token read by Style.qml.

  • Bar settings can now set every numeric token that Style.qml reads.

Reviews (1) · Last reviewed commit: "Merge quattro into allow-bar-token-overr..." · Reviewed by Greptile

Comment on lines +24 to +25
if grep -qF "\"$token\"" <<<"$bar_branch"; then
fail "[bar] accepts $token without naming it, so new tokens do not need parser changes"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Test misses broken overrides

This checks that token names are absent from the parser, not that overrides work. Removing barOut[key] = b would leave every token unwritable while the test still passes. A correct parser that explicitly accepts every token would fail instead.

Call applyShellValues with each discovered token and check the resulting value so the test protects behavior rather than parser wording.

@omarchybot omarchybot removed the bug Something isn't working label Oct 11, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

The bug label is off this PR because the classification is now unsettled. I classed it as a bug: four barToken lookups in Style.qml cannot be set from any shell.toml or theme, and nothing warns about it. Codex Medium, asked separately from the PR alone, classed it as an enhancement, most likely because the description offers either opening the keys or deleting the lookups and leaves that choice to the maintainer. Until the two agree, or the maintainer decides, this waits on the maintainer. The fix itself is unchanged and still verified at 9226c19.

I have also prepared the parts of #13137 that this PR lacks, as one commit on top of 9226c19 crediting @cristian-fleischer. It adds the runtime test from test/shell.d/bar-test.sh, which runs the real applyShellValues and barToken and checks all six keys, so it catches a broken parser that this branch's source-text test would miss (Greptile raised the same gap). It also documents icon-slot, icon-canvas, icon-font and status-slot in docs/omarchy-shell.md and the theme template. I ran it on an Omarchy worker VM. The new test fails on quattro and on this branch with the parser change reverted (icon-slot comes back as 1 instead of 30), and passes on the branch. ./test/cli passes. The full test/shell.d run fails no file on the branch that does not also fail on quattro: one remote-session test failed once and passed on two reruns on both trees. Codex Medium reviewed the commit and found one wording error, that icon-canvas is the square an icon is drawn in rather than the icon's size; that is corrected. I have not pushed it, because this item stops at the classification until that is settled.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants