Yabar() | Yabar() |
Yabar - a modern and lightweight status bar for X window managers.
yabar [-c CONFIG_FILE] [-v] [-h]
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:
bar-list: ["bar1", "bar2", ...]; bar1: {
//bar-specific options//
block-list: ["block1", "block2", ...];
block1: {
//block-specific options//
}
block2: {
//block-specific options//
} }
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.
Each bar can have its font, position (currently only top and bottom), background color, height, horizontal and vertical gaps, and other options.
font: "Droid Sans, FontAwesome Bold 9";
position: "top";
gap-horizontal: 20; gap-vertical: 5;
height: 25;
width: 800;
monitor: "LVDS1"; monitor: "VGA1";
underline-size: 2; overline-size: 2;
slack-size: 2;
border-size: 2; border-color-rgb: 0xffffff;
inherit: "bar1";
You can also inherit a bar with not only its bar-specific options, but also with its blocks and their block-specific options as well using the inherit-all bar-specific option. Example:
inherit-all: "bar1";
command-button4: "xbacklight -inc 1"; command-button5: "xbacklight -dec 1";
Each block can have its command/script, background, foreground (i.e. font), underline and overline colors, alignment and other options.
exec: "date";
align: "right";
justify: "left";
type: "periodic"; type: "persist"; type: "once";
interval: 3;
fixed-size: 90;
pango-markup: true;
foreground-color-rgb : 0xeeeeee; background-color-argb : 0x1dc93582; underline-color-rgb : 0x1d1d1d; overline-color-argb : 0xf0642356;
Note that the values are integers and not double-quoted strings.
command-button1: "pavucontrol"; command-button4: "pactl set-sink-volume 0 +10%"; command-button5: "pactl set-sink-volume 0 -10%";
inherit: "bar1.block1";
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:
"!Y BG 0xFFFF0000 fg0xFF00ff00 U0xFFFAC739 Y!"
"!Ybg0xff00ff00Y!"
The spaces are just skipped automatically. Keep in mind that You can always dynamically change your foreground color using pango markup too.
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. Current env variables are:
${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
${YABAR_BLOCK_WIDTH} #Block width
Yabar has several internal blocks developed 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/script. Internal blocks have 5 additional block-specific options:
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
Yabar has a growing set of useful blocks. The current blocks are:
exec: "YABAR_DATE"; internal-option1: "%a %d %b, %I:%M"; #Format internal-prefix: " "; interval: 2;
exec: "YABAR_TITLE"; fixed-size: 300;
exec: "YABAR_WORKSPACE"; internal-option1: " "; #Type all your workspace names (usually font icons) separated by a space between one another.
exec: "YABAR_UPTIME"; interval: 5;
exec: "YABAR_THERMAL"; internal-option1: "thermal_zone0"; #i.e. Replace `NAME` with your corresponding name interval: 1;
exec: "YABAR_BRIGHTNESS"; internal-option1: "intel_backlight"; #i.e. Replace `NAME` with your corresponding name interval: 1;
exec: "YABAR_BANDWIDTH"; internal-option1: "enp2s0"; #i.e. Replace NAME with your corresponding name internal-option2: " "; #Two Strings (usually 2 font icons) to be injected before down/up values interval: 2;
exec: "YABAR_MEMORY"; interval: 1;
exec: "YABAR_CPU"; interval: 2; internal-prefix: " "; internal-suffix: "%";
exec: "YABAR_DISKIO"; internal-option1: "sda"; #i.e. Replace NAME with your corresponding name internal-option2: " "; #Two Strings (usually 2 font icons) to be injected before down/up values interval: 1;
Yabar is licensed under the MIT license. For more info check out the file LICENSE.
George Badawi <geommer at gmail.com>