Workspaces widget: show what the other monitors are showing (and which way they are) #13786
zc0rp10
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Update (Sep 30): I first worked out the direction relative to the focused monitor. That broke on three screens: from the leftmost one, the middle and right screens both showed as "to the right". Each monitor now gets a fixed slot based on where it sits in the whole layout, so an icon means the same thing whichever screen you're on. With two monitors both approaches give the same result, so the screenshots below still apply.
On a multi-monitor setup the workspaces widget only marks the focused workspace. When I want to jump to a window on another screen, I can't tell from the bar which workspace that screen is showing. I either have to look over at it or guess.
Suggestion: mark the workspace that's visible on each other monitor with a partly filled square. The filled part shows where that monitor sits in your layout:
■focused workspace (unchanged)Each monitor keeps its slot whichever screen you're on, so you learn that "middle third" = the middle screen.
How it works: monitors whose horizontal spans overlap share a column, and overlapping vertical spans share a row, so any layout becomes a small grid (three in a row = 3×1, laptop under an external = 1×2, two externals with a laptop under one = 2×2). The square is split into that grid and the monitor's cell is filled. It's drawn in QML (rounded outline plus a clipped fill) and snapped to whole physical pixels, so it stays crisp and matches the rounded square exactly at fractional scales.
Some Quickshell quirks I ran into, for whoever implements it:
HyprlandMonitor.focusedis never true (Quickshell 0.3.1).Hyprland.focusedMonitorworks.focusedWorkspace/focusedMonitor, each monitor'sactiveWorkspaceand its position are null or wrong until the first workspace event. That also affects the stock widget: after a shell restart it shows no focused workspace until you switch. Readinghyprctl -j monitorsonce at startup covers it.monitor.activeWorkspacegoes stale when a workspace is moved to another monitor, and after a runtime layout change. CallingHyprland.refreshMonitors()onmoveworkspacev2/configreloaded/monitoraddedv2/monitorremovedv2, and when the widget is created (the shell rebuilds the bar on layout changes), fixes both.Screen.devicePixelRatioreports 2 on a 1.25-scaled output; the window'sdevicePixelRatiois correct.It's event-driven with no timers or polling, so there's no idle cost. I've been running it as a cloned
workspacesplugin and I'm happy to open a PR againstshell/plugins/bar/widgets/Workspaces.qmlif this sounds good.Related: #12810 tackles the same multi-monitor problem differently (per-monitor filtering). This keeps all workspaces on every bar but shows where each visible one lives.
All reactions