Yabar is a modern and lightweight status bar that is intended to be used along with minimal X window managers like 'bspwm' and 'i3'. Yabar has the following features:
A Yabar session should contain one or more *bars* within the same session. Each bar should contain one or more *blocks*. Each block should display some useful info to the user (free memory, CPU temperature, etc...).
Yabar currently by default accepts configuration from the config file '~/.config/yabar/yabar.conf' or using 'yabar -c CONFIG_FILE'. The config file should like something like this:
A bar or a block can be named to whatever name (preferably a short and meaningful name). Only names that are included in the "bar-list" and "block-list" entries will be drawn on the screen.
BAR-SPECIFIC OPTIONS
--------------------
Each bar can have its own font, position (currently only top and bottom), background color, height, horizontal and vertical gaps, and other options.
* *Width*: default bar width is 'screen size - 2 * horizontal gap'. However, if this option is used, the bar starts at 'horizontal gap' and ends at 'horizontal gap + width'. Example:
* *Monitor*: specify the monitor using randr extension for the bar to be drawn on. You can find the name of your monitors using 'xrandr -q' command. The default value (when this option is not provided) is the first active monitor. Multiple fallback monitors can be provided if the first option is unavailable. Example:
* *Inheritance*: As the config file gets larger because you want to add several bars, you may find yourself adding many identical option values for every added bar. This optional entry is added in order to inherit the options from a precedent bar into your next bar. You can also override the inherited options with new values.
* *Button commands*: Yabar already supports mouse button commands for each block. Moreover, yabar seeks to make the entire bar clickable even if the pressed area does not belong to any block or the corresponding button command for that block is not defined. Yabar executes the command inside '/bin/sh'. Example:
Yabar sets a handful of environment variables before executing the command that are defined in the 'command-button{1-5}' entry. Such env variables can be useful when drawing your window on the corresponding button press.
----
$YABAR_BLOCK_X # The beginning x axis for the block
$YABAR_BLOCK_Y # It returns just the bottom y value of the block in case of topbar or just the top y value of the block in case of bottombar
* *Execution*: command to be executed or one of Yabar's internal blocks. Yabar consumes the output of the command stdout and displays it on the bar. Example:
* *Type*: The block type can be *periodic* where the command is executed within a fixed interval of time, *persistent* where the command runs in a persistent way like 'xtitle' or *once* where the command is executed only once where the intended info should not change like in 'whoami'. Examples:
* *Fixed size*: define the fixed width size of the block. Yabar currently only supports fixed widths. You can deduce the appropriate width using trial and error. The current default value is 80 but you are encouraged to override it to a more appropriate value. Example:
* *Colors*: each block has 4 kinds of colors. 'Background', 'foreground' which is the font color when pango markup is not used), 'underline' and 'overline'. Colors are accepted in hex 'RRGGBB' and 'AARRGGBB' representations. The values are integers (without quotes). Examples:
* *Button commands*: This option is used to invoke a command/script upon a mouse button press. You have 5 buttons that usually represent left click, right click, middle click, scroll up and scroll down respectively but this may not be the case for everyone. Commands are executed in '/bin/sh'. Examples:
Yabar sets a handful of environment variables before executing your commands/scripts that are defined in the 'command-button{1-5}' entry. Such env variables can be useful when drawing your window on the corresponding button press or determining where the click occured. Current env variables are:
----
$YABAR_BLOCK_X # beginning x axis for the block
$YABAR_BLOCK_Y # bottom y value of the block in case of topbar or top y value of the block in case of bottombar
$YABAR_BLOCK_WIDTH # block width
$YABAR_CLICK_X # x coordinate of the click starting in the top-left corner of the block
$YABAR_CLICK_Y # y coordinate of the click starting in the top-left corner of the block
* *Inheritance*: As the config gets larger because you want to add many blocks, you may find yourself adding many identical option values for every added block. This optional entry is added in order to inherit the options from a precedent block into your new block. You can also override the inherited options with new values.
* *Icons* and *images*: Yabar supports drawing icons and images inside blocks using 'gdk-pixbuf' and 'cairo'. The images are drawn before drawing text so they may act as backgrounds if desired. You can control the horizontal and vertical shift and the width and height scale for the image/icon. Example:
* *Variable width*: Use this optional feature in order to fit the block width into the current text width and subsequently save empty space inside the bar. Example:
You can change block colors ('background', 'foreground', 'underline' and 'overline') within runtime. Along with pango markup format, you can fully control how a block looks throughout yabar's session.
If you wish to change one or more of the 4 color types, you must begin your string-to-be-drawn (i.e. the output string to stdout by your shell script) with '!Y FORMAT Y!'. The 'FORMAT' statement should contain the color type ('BG' or 'bg' for background, 'FG' or 'fg' for foreground, 'U' or 'u' for underline and 'O' or 'o' for overline). The color must be in hex 'AARRGGBB' (So if you want to add an RGB color just make it 'FFxxxxxx'). Examples:
Yabar has several internal blocks written in plain C. This feature is optional and can be disabled before building the code using the compilation conditional flag '-DYA_INTERNAL' in 'Makefile'. Yabar scans the string value in the *exec* entry to check whether it is a reserved internal block or a normal command.
internal-prefix # Inject a string (usually a font icon) before the output string
internal-suffix # Inject a string (usually a font icon) after the output string
internal-option1 # block-specific
internal-option2 # block-specific
internal-option3 # block-specific
internal-spacing # takes a true or false value, used to add space pads to prevent uncomfortable numerical values from moving (only useful for monospace fonts!)
* *YABAR_WORKSPACE* - *Workspace*: Uses EWMH to show the current workspace/desktop. 'internal-option1' represents a series of characters/numbers/names to be used as workspace names (seperated by space). If you want to have spaces in the names that are displayed, insert an alternative unicode spacing character (such as U+2000) instead of a regular space. Example:
* *YABAR_THERMAL* - *Thermal*: Reads thermal value in the file '/sys/class/NAME/temp' and divides it by 1000. Optionally define foreground and background colors for warning and critical temperature levels. Example:
* *YABAR_BANDWDITH* - *Network bandwidth*: Reads the total transmitted and received bytes in the files '/sys/class/net/NAME/statistics/tx_bytes' and '/sys/class/net/NAME/statistics/rx_bytes' and converts them to rates. Example:
* *YABAR_BATTERY* - *Battery*: Reads the files '/sys/class/power_supply/NAME/capacity' and '/sys/class/power_supply/NAME/status' and extracts the capacity value. Example: