add attwm support

This commit is contained in:
2026-07-26 13:48:27 +02:00
parent 9058dd7926
commit 202879eb0e
10 changed files with 404 additions and 44 deletions
+24
View File
@@ -104,6 +104,30 @@ the QML side parses those lines into `tempPath`/`batPath`, which then feed
to pick up layer-surface fixes ahead of release.
- Native Quickshell services back some modules: `Quickshell.I3` (workspaces),
`Quickshell.Services.SystemTray` (tray), PipeWire (volume).
- **Window manager backends are picked by `config/Compositor.qml`**, a singleton
that reads *only* environment variables — Hyprland's instance signature,
`$SWAYSOCK`/`$I3SOCK`, else attwm as the fallback (it announces nothing of its
own, being a river client rather than a compositor). **Never let the detector
do IPC**, and **never read a backend singleton outside its guard**: touching
`Attwm.x` / `I3.x` / `Hyprland.x` instantiates it, and an idle backend sits
there retrying a socket that will never answer. Every use is behind
`Compositor.isAttwm && …` or a `?:` whose untaken branch is never evaluated —
that short-circuit *is* the mechanism. It's verifiable: under attwm the log
has no `$I3SOCK is unset` line, under Sway it does.
- **attwm** (`services/Attwm.qml`, adapted from the reference client in that
repo — keep the two in step) is one `Socket` doing both directions: it
`subscribe`s for a JSON state object per change and writes `attwmctl`-grammar
commands back down the same connection, so a click costs no process spawn.
Its model is dwm's, not i3's — nine fixed tags addressed by *bitmask*
(`tags`/`occupied`), several viewable at once, per output, and no urgency
(the protocol has no attention-request event). `tagCount` deliberately
defaults to 0, not 9, so a wrong detection guess renders nothing instead of a
row of dead tags. `state` is left stale on disconnect so an attwm restart
freezes the bar rather than blanking it.
- Every backend renders through **`widgets/WorkspaceChip.qml`**, whose `dimmed`
and `dot` are presentational rather than semantic — "empty" means different
things per backend (i3 only lists workspaces that exist; attwm always
publishes all nine tags), so the call site decides.
- **Making a module interactive (popups/drawers):** wrap the module's `Pill` in
an `Item` (forward `implicitWidth`/`implicitHeight` from the pill so the bar's
RowLayout still sizes it), add a `MouseArea`, and open a `Quickshell.PopupWindow`;