YABAR(1)

πŸ“¦ version 0.4.0, in debian bookworm, ubuntu jammy, ubuntu noble

✨ yabar(1) β€” the manual, but make it cute ✨

okay bestie, gather round πŸ’– this is yabar, aka the manual page Yabar(), and I'm about to make it make sense.


🌸 NAME 🌸

Yabar β€” a modern and lightweight status bar for X window managers. no cap, that's the whole vibe. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

yabar [-c CONFIG_FILE] [-v] [-h]

that's it. three flags. we love a minimal queen. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, Yabar is a modern and lightweight status bar that's meant to be used along with minimal X window managers like bspwm and i3. she's the little strip of info at the top (or bottom) of your screen and she serves. ✨

Yabar has the following features:

  • Extremely configurable with an easy configuration system using a single config file. one file. that's the whole thing. iconic.
  • A growing set of ready-to-use internal blocks developed in plain c. fr fr.
  • Pango font rendering with support of pango markup language. pretty text, slay.
  • Support for transparency. see-through, like your excuses.
  • Multi-monitor support using RandR. two screens? she got u.
  • Entirely clickable. every pixel, clickable. periodt.
  • Support for several environment variables to help button commands. iykyk.
  • Multiple bars within the same session. more bars, more fun πŸ“

🧚 TERMINOLOGY 🧚

okay so the vocabulary here matters, bestie, let's get it straight:

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...).

so it's like: session β†’ bars β†’ blocks. nesting doll energy. πŸͺ†


🌈 CONFIGURATION 🌈

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.

πŸ’€ real talk: if it's not in the list, it does NOT get drawn. the config doesn't care how cute your name is.

πŸ’– BAR-SPECIFIC OPTIONS πŸ’–

Each bar can have its font, position (currently only top and bottom), background color, height, horizontal and vertical gaps, and other options. let's go one by one, bestie:

  • Font β€” Yabar currently accepts a string that contains a font or a list of fonts (similar to i3). Example:
font: "Droid Sans, FontAwesome Bold 9";
  • Position β€” Yabar currently accepts top and bottom. Example:
position: "top";
  • Gaps β€” You can define the size of horizontal and vertical gaps in pixels. Default is zero. Examples:
gap-horizontal: 20;
gap-vertical: 5;
  • Height β€” Default is 20 pixels. Example:
height: 25;
  • Width β€” The 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:
width: 800;
  • Monitor β€” This option is used to 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 is the first active monitor. Example:
monitor: "LVDS1";
monitor: "VGA1";
  • Underline and overline sizes β€” This option defines the thickness of underlines and overlines. Default is 0. Example:
underline-size: 2;
overline-size: 2;
  • Slack β€” You can define the size of the slack (i.e. the unused space between blocks). Default is 0. Example:
slack-size: 2;
  • Borders β€” You can optionally define a size and a color for a border surrounding the bar. Default is no borders. Example:
border-size: 2;
border-color-rgb: 0xffffff;
  • 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.
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";
  • 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. Example:
command-button4: "xbacklight -inc 1";
command-button5: "xbacklight -dec 1";

πŸŽ€ BLOCK-SPECIFIC OPTIONS πŸŽ€

Each block can have its command/script, background, foreground (i.e. font), underline and overline colors, alignment and other options. here we gooo:

  • Execution β€” The path to the command/script to be executed. Yabar consumes the output of the command/script's stdout and shows it on the bar. Example:
exec: "date";
  • Alignment β€” Yabar accepts left, center or right alignments. consecutive blocks will be placed to the right of each other. Example:
align: "right";
  • Justify β€” By default yabar centers the text inside the block size. However, you can optionally justify the text to the left or the right.
justify: "left";
  • Type β€” The block type can be periodic where the command/script is executed within a fixed interval of time, persistent where the command/script runs in a persistent way like xtitle or once where the command/script is executed only once where the intended info should not change like in whoami. Examples:
type: "periodic";
type: "persist";
type: "once";
  • Interval β€” In seconds. This is only useful when the block type is periodic. Example:
interval: 3;
  • Fixed size β€” You should define the fixed width size of the block. Yabar currently only supports fixed widths (this will be improved soon). 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:
fixed-size: 90;
  • Pango markup β€” Yabar accepts either true or false without quotes. Default is false. Example:
pango-markup: true;
  • Colors β€” A 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. Examples:
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.

πŸ™ˆ do NOT put quotes around these. they're integers. she will simply not vibe with "0xeeeeee".
  • 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. Examples:
command-button1: "pavucontrol";
command-button4: "pactl set-sink-volume 0 +10%";
command-button5: "pactl set-sink-volume 0 -10%";
  • 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.
inherit: "bar1.block1";

πŸ’œ DYNAMIC COLORS FOR BLOCKS πŸ’œ

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.

✨ the way that !Y block just wraps everything and recolors on the fly?? main character energy honestly.

🫢 ENVIRONMENT VARIABLES 🫢

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

so like, when your script runs on a click, she hands you the coordinates. use them. build something iconic. πŸ”₯


✨ INTERNAL BLOCKS ✨

Okay bestie, so Yabar has a bunch of internal blocks written in plain C. This whole feature is optional and you can yeet it before building with the compilation conditional flag -DYA_INTERNAL in the Makefile. Yabar peeks at the string value in the exec entry to figure out if it's a reserved internal block or just a normal command/script. Internal blocks get 5 extra block-specific options:

  • internal-prefix β€” injects a string (usually a font icon) before the output string πŸ’–
  • internal-suffix β€” injects 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:

  • Date and time β€” maybe the most essential block. You can control the output format using the standard C library format in time.h. Example:
exec: "YABAR_DATE";
internal-option1: "%a %d %b, %I:%M"; #Format
internal-prefix: " ";
interval: 2;
  • Current window title β€” it uses EWMH to show the current window title. Example:
exec: "YABAR_TITLE";
fixed-size: 300;
  • Current workspace β€” it uses EWMH to show the current workspace/desktop. Example:
exec: "YABAR_WORKSPACE";
internal-option1: "      "; #Type all your workspace names (usually font icons) separated by a space between one another.
  • Uptime β€” shows the system uptime. Currently it shows using a hours:minutes format. ⏰
exec: "YABAR_UPTIME";
interval: 5;
  • Thermal β€” it checks out the thermal value in the file /sys/class/NAME/temp. Example:
exec: "YABAR_THERMAL";
internal-option1: "thermal_zone0"; #i.e. Replace `NAME` with your corresponding name
interval: 1;
  • Brightness β€” it checks out the brightness value in the file /sys/class/backlight/NAME/brightness. Example:
exec: "YABAR_BRIGHTNESS";
internal-option1: "intel_backlight"; #i.e. Replace `NAME` with your corresponding name
interval: 1;
  • Network bandwidth β€” it checks out 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:
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;
  • Used RAM β€” it checks out the file /proc/meminfo and then computes the total used memory. Example:
exec: "YABAR_MEMORY";
interval: 1;
  • CPU total load β€” it checks out the file /proc/stat and then computes the total load percentage. Example:
exec: "YABAR_CPU";
interval: 2;
internal-prefix: " ";
internal-suffix: "%";
  • Disk IO activity β€” it checks out the file /sys/class/block/NAME/stat and then computes the read and write rates. Example:
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;

πŸ“œ LICENSE πŸ“œ

Yabar is licensed under the MIT license. For more info check out the file LICENSE. Slay, open source bestie. πŸ’–

πŸ‘‘ AUTHOR πŸ‘‘

George Badawi <geommer at gmail.com> β€” the icon, the legend, the author. 🫢


That's the whole page, bestie. The footer tag is Yabar() and the date is whatever your local man page build says. Periodt. πŸ’…

πŸ“¦ where this page comes from