dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Reviews Compare Notes Search Review guide bar: primary-screen-only surfaces, consolidated per-output workspace trays, constant-center clock 98f884968a37487a74934f10442c124d732073f7
Oliver Jan Krylow <oliver@bugabinga.net > · 28 Jun 2026
unsigned
Browse files Compare with HEAD
nuguland's interactive surfaces (bar, OSD, toasts) now render only on the
primary monitor instead of once per screen. Primary is configurable via
shell.primaryOutput (connector name), falling back to the first connected
screen. The wallpaper backdrop and polkit security prompt stay on every
screen by design.
The single primary bar consolidates every output's workspaces, grouping
each output onto its own faint rounded tray so it stays clear which pills
belong to which monitor; trays are ordered by physical output position
(niri logical x). Workspaces focus by unique name, so clicking another
monitor's workspace from the primary bar works cross-output.
The clock is pulled out of the usage-sorted widget order and pinned at a
constant position: centred when the right-side widgets leave room, else just
left of them so it never overlaps a widget. Right-side widgets are
right-anchored at natural width (replacing the fillWidth layout) so they
never truncate while free space remains.
Positions are all derived (parent.width, widgetsRow.x, anchors) and chip
widths now come from BarChip's content-driven sizing, removing the hardcoded
chipWidth() px table.
Supersedes the focused-output gating and per-bar workspace filter; adds a
niriSelfTest IPC that gates the grouping/idx-sort/empty-filter logic with a
synthetic two-output sample (verifiable on a single monitor).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changed files (4) Diff layout Auto Unified Split
quickshell/nuguland/Bar.qml Modified +118 / −80 text lines
56 56 return String (name); return String (name);59 - function chipWidth (name) {60 - switch (String (name)) {72 - return root.audioService && root.audioService.privacyLabel() === "Mic Cam" ? 80 : 62 ;79 - case "notifications" :82 - return root.trayService && root.trayService.attentionCount > 0 ? 66 : 54 ;
90 60 function chipActive (name) { function chipActive (name) {91 61 switch (String (name)) { switch (String (name)) {183 153 color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.55 ) : "transparent" color: root.theme ? root.theme.withAlpha(root.theme.ui.accent, 0.55 ) : "transparent" 187 - anchors.fill: parent162 + label : root.chipLabel("clock" )163 + width : preferredWidth169 + x : Math .min (parent.width / 2 - width / 2 , widgetsRow.x - width - 12 )170 + anchors.verticalCenter: parent.verticalCenter179 + anchors.left: parent.left188 180 anchors.leftMargin: 10 anchors.leftMargin: 10 189 - anchors.rightMargin: 10 181 + anchors.right: clockChip.left182 + anchors.rightMargin: 12 183 + anchors.verticalCenter: parent.verticalCenter189 + model : root.niriService ? root.niriService.workspaceGroups() : []195 - Layout .fillWidth: true 196 - Layout .minimumWidth: 160 197 - Layout .preferredHeight: 26 198 - Layout .alignment: Qt .AlignVCenter205 - model : root.niriService ? root.niriService.workspacesForOutput(root.screen ? root.screen.name : "" ) : []198 + required property var modelData207 - delegate : Rectangle {210 - required property var modelData211 - readonly property bool active : !! modelData.is_focused212 - readonly property string workspaceLabel : ` ${modelData.idx || modelData.id || "?" }${modelData.name ? ` ${modelData.name}` : "" }` .toLowerCase()214 - width : Math .max (34 , workspaceText.implicitWidth + 18 )206 + anchors.verticalCenter: parent.verticalCenter207 + width : pillRow.implicitWidth + 12 215 208 height : 26 height : 26 217 - color : root.theme ? ( active ? root.theme.withAlpha(root.theme.ui.focus , 0 . 28 ) : root . theme . withAlpha ( root . theme . ui . minor, 0.1 ) ) : "transparent" 210 + color : root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.07 ) : "transparent" 223 215 anchors.centerIn: parent anchors.centerIn: parent226 - text : workspaceChip.workspaceLabel227 - color : ! root.theme ? "transparent" : (workspaceChip.active ? root.theme.ui.accent : root.theme.ui.normal)231 - anchors.fill: parent233 - cursorShape : Qt .PointingHandCursor235 - if (root.niriService)236 - root.niriService.focusWorkspace(workspaceChip.modelData.name || workspaceChip.modelData.idx || workspaceChip.modelData.id);219 + model : groupItem.modelData.workspaces224 + required property var modelData226 + width : workspaceChip.width232 + readonly property bool active : !! pillWrap.modelData.is_focused233 + readonly property string workspaceLabel : ` ${pillWrap.modelData.idx || pillWrap.modelData.id || "?" }${pillWrap.modelData.name ? ` ${pillWrap.modelData.name}` : "" }` .toLowerCase()235 + anchors.verticalCenter: parent.verticalCenter236 + width : Math .max (30 , workspaceText.implicitWidth + 16 )239 + color : root.theme ? (active ? root.theme.withAlpha(root.theme.ui.focus, 0.28 ) : root.theme.withAlpha(root.theme.ui.minor, 0.1 )) : "transparent" 245 + anchors.centerIn: parent248 + text : workspaceChip.workspaceLabel249 + color : ! root.theme ? "transparent" : (workspaceChip.active ? root.theme.ui.accent : root.theme.ui.normal)253 + anchors.fill: parent255 + cursorShape : Qt .PointingHandCursor259 + if (root.niriService)260 + root.niriService.focusWorkspace(pillWrap.modelData.name || pillWrap.modelData.idx || pillWrap.modelData.id);248 - Layout .alignment: Qt .AlignVCenter252 - model : root.usageService ? root.usageService.layoutOrder : []255 - required property var modelData287 + anchors.right: parent.right288 + anchors.rightMargin: 10 289 + anchors.verticalCenter: parent.verticalCenter257 - popoutName : modelData258 - label : root.chipLabel(modelData)259 - preferredWidth : root.chipWidth(modelData)293 + model : root.usageService ? root.usageService.layoutOrder : []
296 + required property var modelData298 + popoutName : modelData299 + label : root.chipLabel(modelData)quickshell/nuguland/Niri.qml Modified +121 / −20 text lines
10 10 property string lastError: "" property string lastError: "" 11 11 property var workspaces: [] property var workspaces: []12 12 readonly property var visibleWorkspaces: displayWorkspaces (workspaces) readonly property var visibleWorkspaces: displayWorkspaces (workspaces)16 - readonly property string focusedOutput: {17 - const list = workspaces || [];18 - for (let i = 0 ; i < list.length; i++ )19 - if (list[i].is_focused)20 - return String (list[i].output || "" );
23 13 property var windows: [] property var windows: []24 14 property var outputs: [] property var outputs: []25 15 property var focusedWindow: null property var focusedWindow: null 99 - function workspacesForOutput (outputName) {100 - const all = visibleWorkspaces;101 - const name = String (outputName || "" );102 - if (name.length === 0 )104 - const mine = all.filter((workspace) => String (workspace.output || "" ) === name);105 - return mine.sort((a, b) => Number (a.idx || 0 ) - Number (b.idx || 0 ));89 + function groupWorkspaces (items) {90 + const vis = displayWorkspaces(items === undefined ? workspaces : items);94 + for (let i = 0 ; i < vis.length; i++ ) {95 + const name = String (vis[i].output || "" );96 + if (! byOutput[name]) {100 + byOutput[name].push(vis[i]);102 + return order.map((name) => {105 + "workspaces" : byOutput[name].slice().sort((a, b) => Number (a.idx || 0 ) - Number (b.idx || 0 ))112 + function outputList () {113 + if (Array .isArray (outputs))115 + const obj = outputs || ({117 + return Object .keys (obj).map((key) => {118 + return Object .assign ({126 + function outputX (name) {127 + const list = outputList();128 + const want = String (name || "" );129 + for (let i = 0 ; i < list.length; i++ ) {130 + if (String (list[i].name || "" ) === want) {131 + const logical = list[i].logical || ({133 + return typeof logical.x === "number" ? logical.x : 1000000 ;140 + function workspaceGroups () {141 + return groupWorkspaces(workspaces).slice().sort((a, b) => outputX(a.output) - outputX(b.output));147 + function selfTest () {148 + const failures = [];175 + const groups = groupWorkspaces(sample);176 + if (groups.length !== 2 )177 + failures.push(`expected 2 groups, got ${groups.length}` );179 + const dp1 = groups.filter((g) => g.output === "DP-1" )[0 ] || null ;180 + const dp2 = groups.filter((g) => g.output === "DP-2" )[0 ] || null ;182 + failures.push("missing DP-1 group" );185 + failures.push("missing DP-2 group" );188 + const idxs = JSON .stringify (dp1.workspaces.map((w) => w.idx));189 + if (idxs !== "[1,2,3]" )190 + failures.push(`DP-1 idx order ${idxs} != [1,2,3]` );194 + const idxs = JSON .stringify (dp2.workspaces.map((w) => w.idx));195 + if (idxs !== "[4,5]" )196 + failures.push(`DP-2 idx order ${idxs} != [4,5]` );199 + const total = groups.reduce((sum, g) => sum + g.workspaces.length, 0 );201 + failures.push(`expected 5 pills after empty filter, got ${total}` );204 + "pass" : failures.length === 0 ,205 + "failures" : failures108 209 function parsePickedColor (text) { function parsePickedColor (text) {quickshell/nuguland/Usage.qml Modified +3 / −1 text lines
13 - readonly property var widgets: ["clock " , " launcher" , "media" , "system" , "clipboard" , "audio" , "brightness" , "connectivity" , "power" , "notifications" , "tray" , "idle" ]15 + readonly property var widgets: ["launcher" , "media" , "system" , "clipboard" , "audio" , "brightness" , "connectivity" , "power" , "notifications" , "tray" , "idle" ]16 18 property var layoutOrder: widgets property var layoutOrder: widgetsquickshell/nuguland/shell.qml Modified +27 / −6 text lines
14 + property string primaryOutput : "" 15 + readonly property string primaryScreenName : {16 + const screens = Quickshell .screens;17 + const want = String (shell.primaryOutput || "" );19 + for (let i = 0 ; i < screens.length; i++ )20 + if (String (screens[i].name) === want)23 + return screens.length > 0 ? String (screens[0 ].name) : "" ;11 27 id : nuguTheme id : nuguTheme125 141 objectName: "osdOverlaySurface" objectName: "osdOverlaySurface" 126 142 screen: modelData screen: modelData129 - visible: osd.visibleState && (niri.focusedOutput.length === 0 || modelData.name === niri.focusedOutput)144 + visible: osd.visibleState && modelData.name === shell.primaryScreenName130 145 implicitWidth: 300 implicitWidth: 300 131 146 implicitHeight: osdCard.implicitHeight + 16 implicitHeight: osdCard.implicitHeight + 16 132 147 color: "transparent" color: "transparent" 301 316 objectName: "notificationToastSurface" objectName: "notificationToastSurface" 302 317 screen: modelData screen: modelData305 - visible: toasts.length > 0 && (niri.focusedOutput.length === 0 || modelData.name === niri.focusedOutput)319 + visible: toasts.length > 0 && modelData.name === shell.primaryScreenName306 320 implicitWidth: 380 implicitWidth: 380 307 321 implicitHeight: Math .max(1 , toastColumn.implicitHeight + 16 ) implicitHeight: Math .max(1 , toastColumn.implicitHeight + 16 )308 322 color: "transparent" color: "transparent" 469 483 required property var modelData required property var modelData
487 + visible : modelData.name === shell.primaryScreenName471 488 screen : modelData screen : modelData472 489 theme : nuguTheme theme : nuguTheme473 490 niriService : niri niriService : niri582 599 return niri.stateJson(); return niri.stateJson();
602 + function niriSelfTest () : string {603 + return JSON .stringify (niri.selfTest());585 606 function reloadTheme () { function reloadTheme () {586 607 nuguTheme.reload(); nuguTheme.reload();587 608 return nuguTheme.mode; return nuguTheme.mode;