yaib is a very simple (at this time of writing) status bar for the i3 window manager (X11) that leverages async computation to limit performance bottlenecks. This results in a very resource efficient bar capable of displaying statistics and other things you'd like to display.
yaib is very immature at this writing. Lots of things you want won't be here.
Some features:
- Expandable. Each block has an
iconvalue which can then be clicked on to expand it. Combine it with the urgency coloring values, and you don't have to see text updating all day; just the colors when it matters. - Pages: Flip between lots of different pages using the arrows. This way you can hide less important things you care about in your bar, but get to them when you want to.
- Resource light: yaib is very small and uses almost no resources.
For an example of the expansion, here's the expanded Disk section in the default configuration:
And here it is collapsed (just click):
Release:
cargo install yaib
Development (recommended):
cargo install --git https://github.com/erikh/yaib
yaib
Will emit the bar's contents to standard output in JSON format.
To integrate it into your i3 installation, provide a stanza like so in your
~/.config/i3/config file; remember to remove any other block like it.
NOTE: in this block, you must replace $HOME with your home directory.
bar {
font pango:monospace 10, FontAwesome 10
position bottom
status_command $HOME/.cargo/bin/yaib
colors {
separator #666666
background #222222
statusline #dddddd
focused_workspace #0088CC #0088CC #ffffff
active_workspace #333333 #333333 #ffffff
inactive_workspace #333333 #333333 #888888
urgent_workspace #2f343a #900000 #ffffff
}
}
Do this and reload your configuration (mod + shift + r by default) and the bar should appear!
There is an example configuration file. This
configuration file can either be specified by setting YAIB_CONFIG in the
environment, or by making a file in $XDG_CONFIG_HOME/yaib/yaib.config.yaml.
Field descriptions follow:
update_intervalis the amount of time to wait before polling the system, and displaying new stats. It is specified in fancy duration format which you can read more about at that link.pagesis a list of pages to flip through. Each page consists of a list of items:nameis the name of the block. It is required, and must be unique for all blocks.iconis the short initial clickable content. Not supported on static values. If not provided, it will display the formatted content always.urgencyis a 3-element tuple of values that are all under 100. They correspond to urgency values, green/yellow/red. Not supported on static or music values. When under the minimum, the default text color is used.urgency_colorsis a 3-element tuple of#rrggbbvalues. These values are used when the urgency thresholds are set.typeis the type of block.valueandformatare dependent on this type, so they will be specified with the type below:commandruns a command. It does not run it through a shell, and tokenizes the value by whitespace. The value is the command to run.update_intervalcan be used to override the globalupdate_intervalfor slow running or needlessly updating commands. Seeexample_command.shfor more information. The command must emit (and only emit) a JSON blob with the following three parameters:name: this is the name of the block you configured it with, so it can map back.value: this is the data you want to show in the bar. The icon will be automatically concatenated if it exists.percent: this is optional, an integer from 0-100 which helps with urgency coloring.
dynamicis only for types which are updated by the unix socket (see below). It carries no value and communicates no urgency and has no format.staticjust displays a static string set in thevalue. No formatting is applied.musicdisplays several options for listing the current music track playing via MPRIS (e.g., spotify, xmms). No value is used.%artistis the current artist%titleis the current track title%pct_playedis the whole number percentage of how far along in the track you are.%total_playedis theminute:secondtime well suited for regular updates.
cpuare CPU metrics. Both%count(number of CPUs) and%usageare available as format strings.diskare storage metrics. Thevalueis a mount point.%totalis the total user storage%usageis the amount used%pctis the percent of disk used.
memoryare memory metrics. No value is used.%totalis the total user memory%usageis the amount used%swap_totalis the amount of swap available%swap_usageis the amount of swap used%pctis the percent of memory used.%pct_swapis the percent of swap used.
loadare memory metrics. No value is used.%1is the one minute load average%5is the five minute load average%15is the fifteen minute load average
timeare time metrics. No value is used. The format is chrono's strftime format
NOTE: This layer is likely to be changed dramatically in the future. It is
recommended that if you use this feature, you use it through yaib commands,
and not writing to the socket directly, as the protocol is certain to change.
You can write blocks using the JSON format also used for the command type.
One block per write; use yaib write-block '<block json>' to write directly to
the socket. The socket is also located at /tmp/yaib.sock; only the most
recent copy of yaib running will respond to it, but you can use this with
nc et al to control it. Just barf some JSON at the socket. See
example_command.sh for an example of the output format.
Whatever the block's name value is set to will replace the block in the bar.
If this block is not of a dynamic type in the configuration, it will not
persist and be overwritten by new collection data in the next iteration (this
behavior is expected to change in the future).
MIT
Erik Hollensbe [email protected]