A second shell chrome under dotfiles/quickshell/hyprchrome, built around a BarPanel that carries TWO renderings of its data: the default children are the expanded detail view, `summary` the terse one shown while collapsed. Both stay bound to the same sources, so the densities cannot disagree, and the panel cross-fades between them while its height animates. Panels: HostPanel (hostname, user, timezone, clock), VitalsPanel (CPU load and temperature, memory, GPU load and temperature, all metered), TrayPanel (system tray, self-sizing). HyprChromeBar pins them to DP-2 and owns `expanded` for the whole rail — SUPER A, via GlobalShortcut "chrome". GPU busy comes off sysfs rather than the node_exporter scrape VitalsData already does: the hwmon collector carries the card's temps, power and clocks but not its utilisation. The bar's height binds to each panel's `targetHeight` — where it will settle, not where the animation currently is — because the exclusive zone is window-sized by default, and binding to the animated height relayouts every tiled window on the output twelve times per toggle. The zone follows the target immediately so the desktop reflows once, at the start; the surface itself shrinks only after the panels finish, or it would clip them mid-animation. DebugWindow stages a widget in the middle of the secondary monitor (SUPER CTRL D), masked so only the staged widget takes pointer input. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HEtXvseVb5gwAtKNhFx2PU
81 lines
2.0 KiB
QML
81 lines
2.0 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import Quickshell
|
|
import Quickshell.Services.SystemTray
|
|
import QtQuick
|
|
import qs.hyprchrome.theme
|
|
import qs.hyprchrome.widgets.panels
|
|
|
|
// System tray in the hyprchrome panel chrome, in both densities: the same
|
|
// items, drawn large enough to hit when expanded and shrunk onto the header
|
|
// line when collapsed.
|
|
//
|
|
// Unlike the other panels this one sizes itself horizontally — the item count
|
|
// is whatever the session happens to be running — so a layout can just give it
|
|
// `Layout.fillHeight` and let its implicit width stand.
|
|
BarPanel {
|
|
id: panel
|
|
|
|
panelId: "TRY"
|
|
title: "SYSTEM TRAY"
|
|
meta: panel.itemCount + (panel.itemCount === 1 ? " ITEM" : " ITEMS")
|
|
|
|
readonly property int itemCount: SystemTray.items.values.length
|
|
|
|
implicitWidth: Math.max(panel.headerMinWidth,
|
|
panel.briefLeft + brief.implicitWidth + panel.padding,
|
|
panel.padding * 2 + icons.implicitWidth)
|
|
|
|
// Collapsed: the same icons, small, on the header line.
|
|
summary: Row {
|
|
id: brief
|
|
|
|
spacing: 5
|
|
|
|
Repeater {
|
|
model: SystemTray.items
|
|
|
|
TrayIcon {
|
|
iconSize: 13
|
|
}
|
|
}
|
|
|
|
Text {
|
|
visible: panel.itemCount === 0
|
|
text: "NO ITEMS"
|
|
color: Theme.muted
|
|
font.family: Theme.microFont
|
|
font.pixelSize: 9
|
|
font.letterSpacing: 1.2
|
|
height: 21
|
|
verticalAlignment: Text.AlignVCenter
|
|
}
|
|
}
|
|
|
|
// Expanded: full-size cells.
|
|
Row {
|
|
id: icons
|
|
|
|
spacing: 8
|
|
|
|
Repeater {
|
|
model: SystemTray.items
|
|
|
|
TrayIcon {
|
|
iconSize: 18
|
|
}
|
|
}
|
|
|
|
Text {
|
|
visible: panel.itemCount === 0
|
|
text: "NO ITEMS"
|
|
color: Theme.muted
|
|
font.family: Theme.microFont
|
|
font.pixelSize: 9
|
|
font.letterSpacing: 1.2
|
|
height: 26
|
|
verticalAlignment: Text.AlignVCenter
|
|
}
|
|
}
|
|
}
|