2023-12-29
spatialblock - Generate contents for status bar blocks.
spatialblock config
spatialblock workspace <n>
spatialblock window <n>
spatialblock is a simple program which can be used to populate a status bar compatible with blocks about the current state of spatial(1). Its output satisfies a format very similar to i3blocks(1).
Every line, if not empty, is terminated by a newline character n. Here is a valid output of spatialblock.
1
focus
This format works out of the box with waybar(5). It will probably require a postprocessor for other bars (for instance, i3blocks(1) expects colors, not classes).
config
Output the layout of the current workspace (see spatial(1)).
workspace <n>
Output the icon of the window currently focused in the workspace n. Associate the class focus to the block if the workspace n is currently focused, and unfocus otherwise.
window <n>
Output the icon of the n th window of the current workspace. Associate the class focus to the block if the window is currently focused, and unfocus otherwise.
spatialblock can be configured to associate icons to application ids (typically using a font like Font Awesome or from the Nerd Font family).
spatialblock searches for a config file located at $XDG_CONFIG_HOME/spatial/spatialblock.json. If $XDG_CONFIG_HOME is unset, it defaults to $HOME/.config.
The config file of spatialblock is a JSON array containing objects with two field: app_id and icon. For instance,
[
{ "app_id": "firefox", "icon": "" },
{ "app_id": "kitty", "icon": "" },
{ "app_id": "Slack", "icon": "" },
{ "app_id": "emacs", "icon": "" },
{ "app_id": "neovide", "icon": "" },
{ "app_id": "chromium", "icon": "" }
]
The following environment variables have an effect on Spatial Shell.
XDG_CONFIG_HOME
If set, tells Spatial Shell where to find its config file. If unset, its values is defaulted to $HOME/.config.
Developed by Thomas Letan <lthms@soap.coffee>. Fore more information about Spatial Shell development, see <https://github.com/lthms/spatial-shell>.
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.