Every workspace is listed, hidden ones too; visible is true for the one on screen on its output.
Rects are logical pixels in the output's coordinates, from the settled layout: animation frames do not change them.
Floats stay in windows[] only.
The file is written at most once per second: a change after a quiet second is written at once, later ones are coalesced and the latest is written when the second ends.
How
ports.State.Workspaces (WorkspaceState → ColumnState → TileState), built in the core's publish scratch (no new allocations per frame; publish allocation tests pass), compared deeply in sameState.
columnRectsAt(…, shift) gives the geometry without the view slide's presentation offset.
statefile.Run coalesces writes with one timer.
Checks
make check, make race, make mocks-check, staticcheck ./... pass.
@@ -133,8 +133,11 @@ Workspace IDs are `name:<name>` for named workspaces, stable across launches. Nu
133
133
134
134
NeferWL writes its state as JSON to `$XDG_RUNTIME_DIR/neferwl/<wayland socket>.json`, also given to started programs as `$NEFERWL_STATE`. It lists outputs, workspaces, the focused window, and every window with its app ID, PID, workspace, column and row.
135
135
136
+
The `workspaces` list holds every workspace with its `visible` flag, its columns and the windows in them, each with `x`, `y`, `width` and `height` in logical pixels of its output. The file is written at most once per second.
137
+
136
138
```sh
137
139
neferwl state # the whole state
138
140
neferwl state output-of "$PID"# the output showing that process's window
139
141
neferwl state | jq '[.windows[] | select(.hidden)] | length'# windows in hidden stashes
142
+
neferwl state | jq '.workspaces[] | select(.visible) | .columns[] | .width'# column widths on screen
140
143
```
@@ -133,8 +133,11 @@ Workspace IDs are `name:<name>` for named workspaces, stable across launches. Nu
133
133
134
NeferWL writes its state as JSON to `$XDG_RUNTIME_DIR/neferwl/<wayland socket>.json`, also given to started programs as `$NEFERWL_STATE`. It lists outputs, workspaces, the focused window, and every window with its app ID, PID, workspace, column and row.
134
NeferWL writes its state as JSON to `$XDG_RUNTIME_DIR/neferwl/<wayland socket>.json`, also given to started programs as `$NEFERWL_STATE`. It lists outputs, workspaces, the focused window, and every window with its app ID, PID, workspace, column and row.
135
135
136
+
The `workspaces` list holds every workspace with its `visible` flag, its columns and the windows in them, each with `x`, `y`, `width` and `height` in logical pixels of its output. The file is written at most once per second.
137
+
136
```sh
138
```sh
137
neferwl state # the whole state
139
neferwl state # the whole state
138
neferwl state output-of "$PID"# the output showing that process's window
140
neferwl state output-of "$PID"# the output showing that process's window
139
neferwl state | jq '[.windows[] | select(.hidden)] | length'# windows in hidden stashes
141
neferwl state | jq '[.windows[] | select(.hidden)] | length'# windows in hidden stashes
142
+
neferwl state | jq '.workspaces[] | select(.visible) | .columns[] | .width'# column widths on screen