Add Switch, Btn, and Menu. Share Session and Run.term. Widget skill for agents; no plugin host.
2.8 KiB
2.8 KiB
Quickshell
Tokyo Night bar + overlay shell. QML lives here; Nix copies it into ~/.config/quickshell via ../quickshell.nix and generates Theme.qml from lib/colors.nix.
Layout
- Root
*.qmlsingletons are state (Net,Tail,Sync,Stats,Audio,Fmt,Popups). Filename = type name. Auto-discovered by Quickshell. widgets/are bar chips.ui/is shared chrome. Widgets import".."+"../ui".- Name collisions are avoided by suffixing:
Tail.qml+widgets/Tailnet.qml,Sync.qml+widgets/Syncthing.qml.
Visual rules
- Palette is Tokyo Night. Prefer
Theme.fg/Theme.fgDark/Theme.commentfor text. Accent colors (blue,magenta,cyan,green) are for marks, meters, and wells — not body copy. - Never
property color x: Theme.fg. QML evaluates that once at create time and it freezes to black if Theme is not ready. Useproperty alias color: label.colorand setlabel.color: Theme.fg, orproperty var inkand bindcolor: ink || Theme.fg. - Bar glyphs are ~15px, monochrome, vertically centered with Chip text. Official marks (Tailscale 3×3, Syncthing ring+hub) stay one-color.
- Ranked process lists use
Rank. Dial clusters useGauge. Do not add history sparks. - Panels are
PanelCard. Inset groups useWell. Lists useChoiceonly when they are actions; read-only rows areStatRow. - One popup at a time (
Popups). Panels grow to content up to remaining screen height.
Code rules
- Import
QtQuickanywhere you useTimer,Behavior, orNumberAnimation.Processcannot host aTimer— wrap both inui/Poll.qml. - New files must be
git added beforenh os switch. Flakes ignore untracked paths, so QML will reference a type that is not in the store. - After a failed reload, IPC dies (
Not ready to accept queries yet). Restart withsystemctl --user reset-failed quickshell.service && systemctl --user restart quickshell.service. - After a successful rebuild, apply from the existing herdr split:
nh os switch --diff=always && qs ipc call shell reload. - Poll expensive commands only while the panel is open (
Stats.hot,Net.scan). Keep secrets out of argv; talk to local APIs from QML (XHR), not helper scripts. - Shared formatters live in
Fmt. On/off rows useSwitch. Buttons useBtn. Context menus useMenu. - Launch apps with
Run.detached. Terminal apps:Run.term. Session verbs:Session.run. - Untrusted strings use
Text.PlainText. Image URLs go throughFmt.imageUrl. Folder clicks go throughTheme.openDir.
Adding a widget
Load .agents/skills/qs-widget/SKILL.md. Core chips stay in widgets/ and are mounted in Bar.qml.
Do not
- Generate widget QML from Nix. Only
Theme.qmlis generated. - Add a plugin loader or scan
$HOMEfor QML. - Put Linux-only packages in
home.nix; add them inquickshell.nix.