spatial-ipc(7)
π spatial-ipc(7)
okay so first things first, the vibe: this is a page from the Miscellaneous Information Manual, and its whole name is spatial-ipc(7). say it with me now β spatial-ipc is the IPC protocol for Spatial Shell β¨
π NAME
spatial-ipc β the IPC protocol for Spatial Shell, bestie π
πΈ DESCRIPTION
This man page is literally the blueprint for the IPC protocol that third-party tools can use to control a Spatial Shell instance, or to get info out of one. you're not just reading docs, you're getting the keys to the kingdom π
So, similarly to sway(1), the IPC protocol uses a UNIX socket as the method of communication. The path to the socket is $XDG_RUNTIME_DIR/spatial.sock, and if $XDG_RUNTIME_DIR is unset, it defaults to $HOME/.config.
Write that down. Actually no β I wrote it down for you. slay π«Ά
π¦ MESSAGE AND REPLY FORMAT
The format for messages and replies is exactly the same as sway. See sway-ipc(7). not "similar to", not "inspired by" β exactly the same. no cap π
π MESSAGES AND REPLIES
The following message types and their respective reply are currently supported. here's the whole menu π
0βRUN_COMMANDβ Runs the payload as a Spatial Shell command1βGET_WINDOWSβ Get the list of windows of the current workspace2βGET_WORKSPACESβ Get the list of workspaces with at least one window.3βGET_WORKSPACE_CONFIGβ Get the configuration of the current workspace.
0. RUN_COMMAND π
MESSAGE
Runs the payload as a Spatial Shell command. See spatial(5) for a list of the commands supported by Spatial Shell. it's giving "just tell me what to do and I'll do it" energy π
REPLY
A JSON object with a success boolean property, and its whole job is to witness whether the command has been successfully parsed and interpreted by the Spatial Shell instance, or whether something went wrong π
Examples of reply:
{ "success": true }
{ "success": false }
1. GET_WINDOWS πͺ
MESSAGE
Get the list of windows of the current workspace. No payload expected β don't send one, it's not that kind of party π
REPLY
The reply of the GET_WINDOWS message is a JSON object with the following properties.
focusβ integer β The index of the window currently holding sway's focus.windowsβ list β The list of windows managed by the current workspace.
A window is encoded as an object with the following properties.
app_idβ string β Theapp_idof the window, as reported by sway.nameβ string β The name of the window, as maintained and reported by sway.
Example of reply:
{ "focus": 0,
"windows":
[ { "app_id": "kitty", "name": "zsh" },
{ "app_id": "firefox",
"name":
"Ubuntu Manpage: scdoc - document format for writing manual pages β Mozilla Firefox" } ] }
2. GET_WORKSPACES πΈ
MESSAGE
Get the list of workspaces with at least one window. No payload expected β again, zero payload, we're keeping it clean β¨
REPLY
The reply of the GET_WORKSPACES message is a JSON object with the following properties.
focusβ integer β The index of the workspace currently focused by sway.workspacesβ list β The list of workspaces containing at least one window.
A workspace is encoded as an object with the following properties.
indexβ int β The position of the workspace in Spatial Shell's gride.focused_windowsβ window β The description of the window currently holding the focus.
π«Ά bestie heads up: yes, this table saysfocused_windows(plural) while the example down below writesfocused_window(singular). that's literally what the page says, so I'm not gonna "fix" it and gaslight you. iykyk β copy the example if you want the exact spelling π
Example of reply:
{ "focus": 1,
"workspaces":
[ { "index": 1, "focused_window": { "app_id": "kitty", "name": "zsh" } },
{ "index": 3,
"focused_window":
{ "app_id": "firefox",
"name":
"spatial-shell/README.md at main Β· lthms/spatial-shell Β· GitHub β Mozilla Firefox" } } ] }
3. GET_WORKSPACE_CONFIG π
MESSAGE
Get the configuration of the current workspace. No payload required. main character message: asks for nothing, gets everything π
REPLY
layoutβ string β Eithercolumnormaximize.column_countβ int β The maximum number of windows displayed by Spatial Shell when the layout iscolumn.
Example of reply:
{ "layout": "column", "column_count": 2 }
β AUTHOR
Developed by Thomas Letan <lthms@soap.coffee>. For more information about Spatial Shell development, see <https://github.com/lthms/spatial-shell>.
π§ ACKNOWLEDGMENT
Spatial Shell could not have been possible without sway, which remains a reference and a significant source of inspiration for the software architecture of this project, including for the wording of several man pages. real ones know π like, sway ate and left no crumbs, and we're forever grateful π«Ά
π« and that's the whole page, bestie! this little number is spatial-ipc(7) from the Miscellaneous Information Manual, dated 1980-01-01 β yes, that date, iconic, no notes πβ¨ go forth and talk to your socket π
π
π¦ where this page comes from
- nixos 26.05: ocaml5.4.1-spatial-shell 7
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms