smolbar
is a smol status command for sway.
smolbar
is on crates.io!
console
$ cargo install --locked smolbar
if --config
is not specified, smolbar
looks for the toml configuration file at ~/.config/smolbar/config.toml
.
for an example of a configuration, see the examples.
the header first sent to sway can be configured in the header
table.
it inherets all keys from the Header
JSON object defined in swaybar-protocol(7)
.
there are three scopes which can be used to configure individual blocks.
each scope has a level of control over the Body
s of blocks: immediate
has the highest precidence, then local
, then global
.
global
inherets all keys from the Body
JSON object defined in swaybar-protocol(7)
.
| key | description |
|-------------|----------------------------------------------|
| command_dir | sets the path to execute command(local)
in |
all local blocks are tables in the table array block
.
local
inherets all keys from the Body
JSON object defined in swaybar-protocol(7)
.
| key | description |
|----------|-------------------------------------------------------------|
| command | (optional) command to execute for immediate
configuration |
| prefix | string prefixing full_text
|
| postfix | string appended to full_text
|
| interval | interval, in seconds, at which to refresh the block |
| signal | os signal to refresh the block when received |
each line of command(local)
's standard output is parsed in order as a field of the Body
JSON object defined in swaybar-protocol(7)
.
for example, suppose the following script was a block's command:
```sh
full_text
echo "amazing status information"
short_text
echo "short info"
color
echo "#ff0000" ```
smolbar
responds to cont_signal
(see swaybar-protocol(7)
) by reloading its configuration.
this means that by default, sending smolbar
's process SIGCONT
will cause it to hot swap its config.
```toml [header]
```
```console $ pkill -SIGCONT smolbar
```
cont_signal
is also configurable.
toml
[header]
cont_signal = 10
```console $ pkill --signal 10 smolbar
```
the header, fundamentally, can't be reconfigured during runtime.
this is because in swaybar-protocol(7)
, it's only sent once, at the beginning of the status command's process.