feat(bar): add bar.screens to restrict the bar to specific monitors - #6501
feat(bar): add bar.screens to restrict the bar to specific monitors#6501fivves wants to merge 2 commits into
Conversation
Adds an optional screens list to the bar: section of shell.json.
When set to output names like ["DP-1"], only those screens get a bar
panel plus the drag/move ghost panels. Empty or unset keeps the
default of one bar per screen.
The bar was hardcoded to create a panel on every screen via
Variants { model: Quickshell.screens } with no config option, so a
single-monitor bar required editing Bar.qml, which gets clobbered on
every omarchy update.
- shell/plugins/bar/Bar.qml: screenFilter/barScreens properties; all
three Variants bind to barScreens
- shell/shell.qml: screens: [] in the builtin fallback config
- config/omarchy/shell.json: screens: [] in the default config
- docs/omarchy-shell.md and shell/plugins/bar/README.md: document the key
There was a problem hiding this comment.
Pull request overview
Adds monitor-specific filtering for the built-in bar while preserving all-screen defaults.
Changes:
- Filters bar and ghost panels by configured output names.
- Adds default
screens: []configuration. - Documents
bar.screens.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
shell/plugins/bar/Bar.qml |
Implements reactive screen filtering. |
shell/shell.qml |
Adds the fallback default. |
config/omarchy/shell.json |
Adds the shipped default. |
shell/plugins/bar/README.md |
Documents bar configuration. |
docs/omarchy-shell.md |
Documents the shell-level setting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| readonly property var barScreens: root.screenFilter.length > 0 | ||
| ? Quickshell.screens.filter(s => root.screenFilter.indexOf(s.name) !== -1) | ||
| : Quickshell.screens |
There was a problem hiding this comment.
Addressed in 78a688c. Moved the filter logic from Bar.qml into BarModel.js (screenNames/screensFor) so it runs in the existing node harness, and added 11 assertions to test/shell.d/bar-test.sh covering omitted/empty filters, matching and non-matching output names, non-array tolerance, and all three per-screen Variants binding the configured filter. Caveat: this harness cannot execute QML, so live hotplug re-evaluation is not directly testable here — the barScreens binding references Quickshell.screens and barConfig directly, so it re-evaluates on screen changes and config reloads, and the structural wiring is now guarded by the suite.
| 9. `bar.screens` is an optional list of Wayland output names that limits | ||
| which monitors get a bar (e.g. `["DP-1"]`). Empty or omitted means every | ||
| screen gets a bar. |
There was a problem hiding this comment.
Fixed in 78a688c. Rule 9 now scopes bar.screens to the built-in bar (omarchy.bar) and notes that replacement bar plugins receive barConfig but must implement the filtering themselves.
- Move the screen filter logic from Bar.qml into BarModel.js (screenNames/screensFor) so it is unit-testable in the existing node harness - bar-test.sh: 11 new assertions covering omitted/empty filters, matching and non-matching output names, non-array tolerance, and all three per-screen Variants binding the configured filter - docs/omarchy-shell.md: scope rule 9 to the built-in bar; replacement bar plugins receive barConfig but must implement filtering themselves
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (1)
shell/plugins/bar/Bar.qml:56
- The filter only changes the three bar
Variants, but the notification service still creates a popup on everyQuickshell.screensoutput and always callspopupPlacementwith the global bar clearance (shell/plugins/notifications/Service.qml:788-804). Withscreens: ["DP-1"], notifications on every other output remain displaced as though a top/right bar existed. Please expose/check whethermodelDatais included in the bar screen filter and use only the outer gap when that output has no bar.
readonly property var barScreens: BarModel.screensFor(barConfig, Quickshell.screens)
Summary
The bar currently creates a panel on every connected screen (
Variants { model: Quickshell.screens }). On multi-monitor setups there's no way to keep the bar on just one monitor — the only workaround is editing Bar.qml directly, which gets clobbered on every omarchy update. Waybar solved this years ago with a per-output config; this brings the same idea to shell.json.Adds an optional
bar.screenskey: a list of Wayland output names the bar should be created on. Empty or omitted keeps the current behavior (bar on every screen).{ "bar": { "position": "top", "screens": ["DP-1"] } }Changes
screens: []in the builtin fallback config"screens": []in the default configBehavior
"screens": ["DP-1"]: only DP-1 gets a bar; names matchhyprctl monitorsoutputTesting