refactor(quickshell): move every color and font into a Theme singleton

The shell was running two unrelated palettes: an amber one (#FFD063 accent,
#EEEEEE text, #0F1012 panels) hardcoded as ~200 raw hex literals across the
launchers, sidebar, systray, vitals and notifications, and an orange one
(#e8722a) that only the dense bar had, tokenized as per-file properties.

This unifies on the ORANGE values under the AMBER naming scheme, and moves the
lot into widgets/theme/Theme.qml. `surface` takes the dense bar's void
(#0a0a0a) rather than the old panel background. Zero color and font literals
remain anywhere under widgets/ outside Theme.qml.

Collisions resolved, all near-duplicates that wanted to be one token:
  - #0F1012 + #0A0A0C + #0a0a0a -> surface
  - #EEEEEE + #dedede           -> text
  - #7A7B7D + #858585           -> muted
  - #292C30 + #22262C           -> raised
  - #FFD063 + #e8722a           -> accent

Two derived things rather than literals. accentSoft (the pale flash the
top/bottom bars show while a launcher is open) was a hand-picked #FFF3C0
against amber, which is simply wrong against orange; it is now
Qt.tint(accent, white 55%), a ratio checked against the original (amber tinted
55% gives #FFE9B8 vs the hand-picked #FFF3C0). And the dense bar had been
hand-encoding Qt.rgba(0.87,0.87,0.87,a) and Qt.rgba(0.91,0.45,0.16,a), which
are just text and accent at alpha -- now textAlpha(a)/accentAlpha(a), so they
track a palette change instead of silently drifting.

Fonts came along too. Digital-7 Mono is dropped for DepartureMono: it was
never packaged, relying on a manual ~/.dots/fonts/digital_7 install that does
not exist on terra, so `fc-match "Digital-7 Mono"` resolved to DejaVu Sans and
all 38 of those sites -- the launcher lists, sidebar clock, systray labels,
every vitals readout -- were silently rendering in a PROPORTIONAL fallback.
Numeric columns should visibly improve. readoutFont is an alias of displayFont
rather than a second literal so the two roles cannot drift apart.

quickshell/CLAUDE.md updated: it said "No shared theme/tokens file yet" and
told contributors to grep for the existing hex color, which would now
reintroduce exactly what this removes.

Verified: no file references Theme. without the import, none imports it
unused, and the whole shell -- launchers, sidebar, vitals, systray,
notifications, not just the harness -- hot-reloaded clean on terra.
tests/HeadlessSmoke.qml deliberately keeps its own copies; its value is having
no dependencies.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgcWkm3t6BDQktYHQvb8Hx
This commit is contained in:
2026-08-28 07:56:25 +02:00
co-authored by Claude Opus 5
parent 01bc169180
commit b16cc93ff6
22 changed files with 390 additions and 323 deletions
+43 -42
View File
@@ -6,6 +6,7 @@ import Quickshell.Wayland
import QtQuick
import QtQuick.Layouts
import QtQuick.Shapes
import qs.widgets.theme
// Host vitals HUD — the "Slant" language (chamfered panel, trapezoid bevels,
// outward corner chunks, floating cap, slanted dividers) carried over from the
@@ -59,7 +60,7 @@ Scope {
// Dim backdrop — click anywhere to dismiss.
Rectangle {
anchors.fill: parent
color: "#0A0A0C"
color: Theme.surface
opacity: 0.5
MouseArea {
@@ -102,8 +103,8 @@ Scope {
preferredRendererType: Shape.CurveRenderer
ShapePath {
fillColor: "#0F1012"
strokeColor: "#FFD063"
fillColor: Theme.surface
strokeColor: Theme.accent
strokeWidth: 2
startX: frame.chamfer
@@ -121,7 +122,7 @@ Scope {
// Thick top-left bevel accent.
ShapePath {
strokeWidth: 0
fillColor: "#FFD063"
fillColor: Theme.accent
startX: 0
startY: frame.chamfer
@@ -134,7 +135,7 @@ Scope {
// Thick bottom-right bevel accent.
ShapePath {
strokeWidth: 0
fillColor: "#FFD063"
fillColor: Theme.accent
startX: panelShape.width
startY: panelShape.height - frame.chamfer
@@ -147,7 +148,7 @@ Scope {
// Floating triangle cap in the bottom-right notch.
ShapePath {
strokeWidth: 0
fillColor: "#FFD063"
fillColor: Theme.accent
startX: panelShape.width
startY: panelShape.height
@@ -159,7 +160,7 @@ Scope {
// Heavy outward chunk wrapping the bottom-left corner.
ShapePath {
strokeWidth: 0
fillColor: "#FFD063"
fillColor: Theme.accent
startX: panelShape.width / 3
startY: panelShape.height
@@ -176,7 +177,7 @@ Scope {
// Heavy outward chunk wrapping the top-right corner.
ShapePath {
strokeWidth: 0
fillColor: "#FFD063"
fillColor: Theme.accent
startX: panelShape.width
startY: panelShape.height / 3
@@ -217,7 +218,7 @@ Scope {
ShapePath {
strokeWidth: 0
fillColor: "#FFD063"
fillColor: Theme.accent
startX: 6
startY: 0
PathLine { x: 10; y: 0 }
@@ -227,7 +228,7 @@ Scope {
}
ShapePath {
strokeWidth: 0
fillColor: "#FFD063"
fillColor: Theme.accent
startX: 15
startY: 0
PathLine { x: 19; y: 0 }
@@ -237,7 +238,7 @@ Scope {
}
ShapePath {
strokeWidth: 0
fillColor: "#FFD063"
fillColor: Theme.accent
startX: 24
startY: 0
PathLine { x: 28; y: 0 }
@@ -249,8 +250,8 @@ Scope {
Text {
text: (vitals.host || "vitals").toUpperCase()
color: "#EEEEEE"
font.family: "Digital-7 Mono"
color: Theme.text
font.family: Theme.readoutFont
font.pointSize: 20
font.letterSpacing: 2
}
@@ -261,15 +262,15 @@ Scope {
Text {
text: "UP"
color: "#7A7B7D"
font.family: "Digital-7 Mono"
color: Theme.muted
font.family: Theme.readoutFont
font.pointSize: 11
}
Text {
text: vitals.fmtUptime(vitals.uptime)
color: "#FFD063"
font.family: "Digital-7 Mono"
color: Theme.accent
font.family: Theme.readoutFont
font.pointSize: 16
}
}
@@ -281,8 +282,8 @@ Scope {
Layout.fillWidth: true
visible: vitals.failed
text: "NODE_EXPORTER UNREACHABLE ON :" + vitals.port
color: "#FF6B4A"
font.family: "Digital-7 Mono"
color: Theme.hot
font.family: Theme.readoutFont
font.pointSize: 13
}
@@ -353,7 +354,7 @@ Scope {
Text {
Layout.preferredWidth: 96
text: diskRow.modelData.mount
color: "#7A7B7D"
color: Theme.muted
font.pointSize: 9
elide: Text.ElideMiddle
}
@@ -369,8 +370,8 @@ Scope {
Layout.preferredWidth: 48
horizontalAlignment: Text.AlignRight
text: Math.round(diskRow.frac * 100) + "%"
color: diskRow.frac >= 0.9 ? "#FF6B4A" : "#EEEEEE"
font.family: "Digital-7 Mono"
color: diskRow.frac >= 0.9 ? Theme.hot : Theme.text
font.family: Theme.readoutFont
font.pointSize: 13
}
@@ -378,8 +379,8 @@ Scope {
Layout.preferredWidth: 104
horizontalAlignment: Text.AlignRight
text: vitals.fmtBytes(diskRow.modelData.size - diskRow.modelData.used) + " FREE"
color: "#7A7B7D"
font.family: "Digital-7 Mono"
color: Theme.muted
font.family: Theme.readoutFont
font.pointSize: 11
}
}
@@ -399,21 +400,21 @@ Scope {
Text {
Layout.preferredWidth: 96
text: vitals.netIface || "NET"
color: "#7A7B7D"
color: Theme.muted
font.pointSize: 9
}
Text {
text: "RX"
color: "#7A7B7D"
font.family: "Digital-7 Mono"
color: Theme.muted
font.family: Theme.readoutFont
font.pointSize: 11
}
Text {
text: vitals.fmtRate(vitals.netRx)
color: "#FFD063"
font.family: "Digital-7 Mono"
color: Theme.accent
font.family: Theme.readoutFont
font.pointSize: 14
}
@@ -423,15 +424,15 @@ Scope {
Text {
text: "TX"
color: "#7A7B7D"
font.family: "Digital-7 Mono"
color: Theme.muted
font.family: Theme.readoutFont
font.pointSize: 11
}
Text {
text: vitals.fmtRate(vitals.netTx)
color: "#FFD063"
font.family: "Digital-7 Mono"
color: Theme.accent
font.family: Theme.readoutFont
font.pointSize: 14
// Right-align the TX readout against the panel edge the
@@ -469,8 +470,8 @@ Scope {
Text {
Layout.preferredWidth: 46
text: metric.label
color: "#FFD063"
font.family: "Digital-7 Mono"
color: Theme.accent
font.family: Theme.readoutFont
font.pointSize: 15
font.letterSpacing: 1
}
@@ -486,8 +487,8 @@ Scope {
Layout.preferredWidth: 54
horizontalAlignment: Text.AlignRight
text: metric.readout
color: "#EEEEEE"
font.family: "Digital-7 Mono"
color: Theme.text
font.family: Theme.readoutFont
font.pointSize: 16
}
}
@@ -499,8 +500,8 @@ Scope {
Text {
text: metric.detail
color: "#7A7B7D"
font.family: "Digital-7 Mono"
color: Theme.muted
font.family: Theme.readoutFont
font.pointSize: 11
}
@@ -511,8 +512,8 @@ Scope {
Text {
visible: metric.aside.length > 0
text: metric.aside
color: metric.asideHot ? "#FF6B4A" : "#7A7B7D"
font.family: "Digital-7 Mono"
color: metric.asideHot ? Theme.hot : Theme.muted
font.family: Theme.readoutFont
font.pointSize: 11
}
}
@@ -530,7 +531,7 @@ Scope {
ShapePath {
strokeWidth: 0
fillColor: "#FFD063"
fillColor: Theme.accent
startX: 6
startY: 0
PathLine { x: divider.width; y: 0 }