docs(desktop): describe workspace geometry in the state file
1 file · +3 -0
M docs/desktop.md +3 -0
| @@ -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 | |||
| 140 | ``` | 143 | ``` | ||