mirror of
https://github.com/vale981/yabar
synced 2025-03-05 09:31:39 -05:00
Update documentation from wiki pages
This commit is contained in:
parent
a17d63448e
commit
dc035f51fa
1 changed files with 59 additions and 60 deletions
|
@ -32,7 +32,7 @@ Yabar is a modern and lightweight status bar that is intended to be used along w
|
||||||
|
|
||||||
TERMINOLOGY
|
TERMINOLOGY
|
||||||
-----------
|
-----------
|
||||||
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...).
|
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...).
|
||||||
|
|
||||||
CONFIGURATION
|
CONFIGURATION
|
||||||
-------------
|
-------------
|
||||||
|
@ -59,50 +59,50 @@ 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.
|
Each bar can have its own font, position (currently only top and bottom), background color, height, horizontal and vertical gaps, and other options.
|
||||||
|
|
||||||
* *Font*: Yabar currently accepts a string that contains a font or a list of fonts
|
* *Font*: accepts a string that contains a font or a list of fonts
|
||||||
(similar to i3). Example:
|
(similar to i3). Example:
|
||||||
----
|
----
|
||||||
font: "Droid Sans, FontAwesome Bold 9";
|
font: "Droid Sans, FontAwesome Bold 9";
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Position*: Position Yabar at the top or bottom. Example:
|
* *Position*: position of the bar. Top or bottom are supported. Example:
|
||||||
----
|
----
|
||||||
position: "top";
|
position: "top";
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Gaps*: You can define the size of horizontal and vertical gaps in pixels. Default is zero. Examples:
|
* *Gaps*: set the size of horizontal and vertical gaps in pixels. Default is 0. Examples:
|
||||||
----
|
----
|
||||||
gap-horizontal: 20;
|
gap-horizontal: 20;
|
||||||
gap-vertical: 5;
|
gap-vertical: 5;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Height*: Default is 20 pixels. Example:
|
* *Height*: height of the bar. Default is 20 pixels. Example:
|
||||||
----
|
----
|
||||||
height: 25;
|
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*: 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;
|
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 (when this option is not provided) is the first active monitor. Fallback monitors can be provided if the first option is unavailable. 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:
|
||||||
----
|
----
|
||||||
monitor: "LVDS1 VGA1";
|
monitor: "LVDS1 VGA1";
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Underline* and *overline sizes*: This option defines the thickness of underlines and overlines. Default is 0. Example:
|
* *Underline* and *overline sizes*: set the thickness of underlines and overlines. Default is 0. Example:
|
||||||
----
|
----
|
||||||
underline-size: 2;
|
underline-size: 2;
|
||||||
overline-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*: set the size of the slack (i.e. the unused space between blocks). Default is 0. Example:
|
||||||
----
|
----
|
||||||
slack-size: 2;
|
slack-size: 2;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Borders*: You can optionally define a size and a color for a border surrounding the bar. Default is no borders. Example:
|
* *Borders*: optionally define a size and color for a border surrounding the bar. Default is no borders. Example:
|
||||||
----
|
----
|
||||||
border-size: 2;
|
border-size: 2;
|
||||||
border-color-rgb: 0xffffff;
|
border-color-rgb: 0xffffff;
|
||||||
|
@ -110,35 +110,42 @@ 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.
|
* *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 bar-specific options:
|
||||||
inherit: "bar1";
|
inherit: "bar1";
|
||||||
----
|
# inherit bar-specific options along with all blocks and their options
|
||||||
|
|
||||||
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";
|
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:
|
* *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:
|
||||||
----
|
----
|
||||||
|
command-button1: "pavucontrol || alsamixer";
|
||||||
command-button4: "xbacklight -inc 1";
|
command-button4: "xbacklight -inc 1";
|
||||||
command-button5: "xbacklight -dec 1";
|
command-button5: "xbacklight -dec 1";
|
||||||
----
|
----
|
||||||
|
|
||||||
|
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
|
||||||
|
$YABAR_BLOCK_WIDTH # Block width
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
BLOCK-SPECIFIC OPTIONS
|
BLOCK-SPECIFIC OPTIONS
|
||||||
----------------------
|
----------------------
|
||||||
Each block can have its own command, background, foreground (i.e. font), underline and overline colors, alignment and other options.
|
Each block can have its own command, background, foreground (i.e. font), underline and overline colors, alignment and other options.
|
||||||
|
|
||||||
* *Execution*: The path to the command (executable or script) to be executed. Yabar consumes the output of the command/script's stdout and shows it on the bar. Example:
|
* *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:
|
||||||
----
|
----
|
||||||
exec: "date";
|
exec: "date +%F";
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Alignment*: Yabar accepts left, center or right alignments. Consecutive blocks will be placed to the right of each other. Example:
|
* *Alignment*: accepts 'left', 'center' or 'right' alignments. Consecutive blocks will be placed to the right of each other. Example:
|
||||||
----
|
----
|
||||||
align: "right";
|
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*: By default, text is centered inside the block size. However, you can optionally justify the text to the left or the right.
|
||||||
----
|
----
|
||||||
justify: "left";
|
justify: "left";
|
||||||
----
|
----
|
||||||
|
@ -150,22 +157,22 @@ type: "persist";
|
||||||
type: "once";
|
type: "once";
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Interval*: In seconds. This is only useful when the block type is *periodic*. Example:
|
* *Interval*: interval in seconds for 'periodic' blocks. Example:
|
||||||
----
|
----
|
||||||
interval: 3;
|
interval: 3;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Fixed size*: You should 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:
|
* *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:
|
||||||
----
|
----
|
||||||
fixed-size: 90;
|
fixed-size: 90;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Pango markup*: Yabar accepts either true or false without quotes. Default is false. Example:
|
* *Pango markup*: en- or disable Pango Markup. Accepts either 'true' or 'false' (without quotes). Default is false. Example:
|
||||||
----
|
----
|
||||||
pango-markup: true;
|
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. Note that the values are integers and not double-quoted strings. Examples:
|
* *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:
|
||||||
----
|
----
|
||||||
foreground-color-rgb: 0xeeeeee;
|
foreground-color-rgb: 0xeeeeee;
|
||||||
background-color-argb: 0x1dc93582;
|
background-color-argb: 0x1dc93582;
|
||||||
|
@ -173,9 +180,9 @@ underline-color-rgb: 0x1d1d1d;
|
||||||
overline-color-argb: 0xf0642356;
|
overline-color-argb: 0xf0642356;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *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:
|
* *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:
|
||||||
----
|
----
|
||||||
command-button1: "pavucontrol";
|
command-button1: "pavucontrol || alsamixer";
|
||||||
command-button4: "pactl set-sink-volume 0 +10%";
|
command-button4: "pactl set-sink-volume 0 +10%";
|
||||||
command-button5: "pactl set-sink-volume 0 -10%";
|
command-button5: "pactl set-sink-volume 0 -10%";
|
||||||
----
|
----
|
||||||
|
@ -188,10 +195,10 @@ inherit: "bar1.block1";
|
||||||
* *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:
|
* *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:
|
||||||
----
|
----
|
||||||
image: "/usr/share/icons/Numix/16/apps/google.svg";
|
image: "/usr/share/icons/Numix/16/apps/google.svg";
|
||||||
image-shift-x: 2; #integer value
|
image-shift-x: 2; # integer value
|
||||||
image-shift-y: 1; #integer value
|
image-shift-y: 1; # integer value
|
||||||
image-scale-width: 0.4; #float value
|
image-scale-width: 0.4; # float value
|
||||||
image-scale-height: 0.4; #float value
|
image-scale-height: 0.4; # float value
|
||||||
----
|
----
|
||||||
|
|
||||||
* *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:
|
* *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:
|
||||||
|
@ -209,21 +216,12 @@ If you wish to change one or more of the 4 color types, you must begin your stri
|
||||||
"!Ybg0xff00ff00Y!"
|
"!Ybg0xff00ff00Y!"
|
||||||
----
|
----
|
||||||
|
|
||||||
The spaces are just skipped automatically. Keep in mind that You can always dynamically change your foreground color using pango markup too.
|
Spaces are skipped automatically. Keep in mind that you can always dynamically change your foreground color using pango markup too.
|
||||||
|
|
||||||
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
|
|
||||||
----
|
|
||||||
|
|
||||||
INTERNAL BLOCKS
|
INTERNAL BLOCKS
|
||||||
---------------
|
---------------
|
||||||
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.
|
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 blocks have 5 additional block-specific options:
|
Internal blocks have 5 additional block-specific options:
|
||||||
----
|
----
|
||||||
internal-prefix # Inject a string (usually a font icon) before the output string
|
internal-prefix # Inject a string (usually a font icon) before the output string
|
||||||
|
@ -236,84 +234,85 @@ internal-spacing # takes a true or false value, used to add space pads to preven
|
||||||
|
|
||||||
Yabar has a growing set of internal blocks. The current blocks are:
|
Yabar has a growing set of internal blocks. The current blocks are:
|
||||||
|
|
||||||
* *Date and time*: You can control the output format using the standard C library format in 'time.h'. Example:
|
* *YABAR_DATE* - *Date and time*: You can control the output format using the standard C library format in 'time.h'. Example:
|
||||||
----
|
----
|
||||||
exec: "YABAR_DATE";
|
exec: "YABAR_DATE";
|
||||||
internal-option1: "%a %d %b, %I:%M"; # Format String
|
internal-option1: "%a %d %b, %I:%M"; # Format String
|
||||||
internal-prefix: " ";
|
internal-prefix: " ";
|
||||||
interval: 2;
|
interval: 1;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Window title*: Uses EWMH to show the current window title. Example:
|
* *YABAR_TITLE* - *Window title*: Uses EWMH to show the current window title. Example:
|
||||||
----
|
----
|
||||||
exec: "YABAR_TITLE";
|
exec: "YABAR_TITLE";
|
||||||
fixed-size: 300;
|
fixed-size: 300;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Workspace*: Uses EWMH to show the current workspace/desktop. Example:
|
* *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). Example:
|
||||||
----
|
----
|
||||||
exec: "YABAR_WORKSPACE";
|
exec: "YABAR_WORKSPACE";
|
||||||
internal-option1: " "; #Type all your workspace names (usually font icons) separated by a space between one another.
|
internal-option1: " ";
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Uptime*: displays system uptime in 'hours:minutes' format.
|
* *YABAR_UPTIME* - *Uptime*: displays system uptime in 'hours:minutes' format.
|
||||||
----
|
----
|
||||||
exec: "YABAR_UPTIME";
|
exec: "YABAR_UPTIME";
|
||||||
interval: 5;
|
type: "periodic";
|
||||||
|
interval: 60;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Thermal*: It checks the thermal value in the file '/sys/class/NAME/temp'. 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:
|
||||||
----
|
----
|
||||||
exec: "YABAR_THERMAL";
|
exec: "YABAR_THERMAL";
|
||||||
internal-option1: "thermal_zone0";
|
internal-option1: "thermal_zone0";
|
||||||
|
internal-option2: "70; 0xFFFFFFFF; 0xFFED303C"; # Critical Temperature, fg, bg
|
||||||
|
internal-option3: "58; 0xFFFFFFFF; 0xFFF4A345"; # Warning Temperature, fg, bg
|
||||||
interval: 1;
|
interval: 1;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Brightness*: It checks the brightness value in the file '/sys/class/backlight/NAME/brightness'. Example:
|
* *YABAR_BRIGHTNESS* - *Brightness*: Reads the current brightness from '/sys/class/backlight/NAME/brightness'. Example:
|
||||||
----
|
----
|
||||||
exec: "YABAR_BRIGHTNESS";
|
exec: "YABAR_BRIGHTNESS";
|
||||||
internal-option1: "intel_backlight";
|
internal-option1: "intel_backlight";
|
||||||
interval: 1;
|
interval: 1;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Network bandwidth*: It checks 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_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:
|
||||||
----
|
----
|
||||||
exec: "YABAR_BANDWIDTH";
|
exec: "YABAR_BANDWIDTH";
|
||||||
internal-option1: "default"; #Possible values are 'default' or any interface name (e.g. 'eth0', 'wlan1')
|
internal-option1: "default"; # Possible values are 'default' or any interface name (e.g. 'eth0', 'wlan1')
|
||||||
internal-option2: " "; #Two Strings (usually 2 font icons) to be injected before down/up values
|
internal-option2: " "; # Two Strings (usually 2 font icons) to be injected before down/up values
|
||||||
interval: 2;
|
interval: 2;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *RAM Usage*: It checks the file '/proc/meminfo' and computes the total used memory. Example:
|
* *YABAR_MEMORY* - *RAM Usage*: Reads the file '/proc/meminfo' and computes the total used memory. Example:
|
||||||
----
|
----
|
||||||
exec: "YABAR_MEMORY";
|
exec: "YABAR_MEMORY";
|
||||||
interval: 1;
|
interval: 1;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *CPU total load*: It checks out the file '/proc/stat' and computes the total load percentage: Example:
|
* *YABAR_CPU* - *CPU total load*: Reads the file '/proc/stat' and computes the total load percentage: Example:
|
||||||
----
|
----
|
||||||
exec: "YABAR_CPU";
|
exec: "YABAR_CPU";
|
||||||
interval: 2;
|
interval: 2;
|
||||||
internal-prefix: " ";
|
internal-prefix: " ";
|
||||||
internal-suffix: "%";
|
internal-suffix: "%";
|
||||||
internal-spacing: true;
|
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Disk IO activity*: It checks the file '/sys/class/block/NAME/stat' and computes the read and write rates. Example:
|
* *YABAR_DISKIO* - *Disk IO activity*: Reads the file '/sys/class/block/NAME/stat' and computes the read and write rates. Example:
|
||||||
----
|
----
|
||||||
exec: "YABAR_DISKIO";
|
exec: "YABAR_DISKIO";
|
||||||
internal-option1: "sda";
|
internal-option1: "sda";
|
||||||
internal-option2: " "; #Two Strings (usually 2 font icons) to be injected before down/up values
|
internal-option2: " "; # Two Strings (usually 2 font icons) to be injected before down/up values
|
||||||
interval: 1;
|
interval: 1;
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Battery*: It checks the files '/sys/class/power_supply/NAME/capacity' and '/sys/class/power_supply/NAME/status' and extracts the capacity value. 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:
|
||||||
----
|
----
|
||||||
exec: "YABAR_BATTERY";
|
exec: "YABAR_BATTERY";
|
||||||
internal-option1: "BAT0";
|
internal-option1: "BAT0";
|
||||||
internal-option2: " ";
|
internal-option2: " "; # icons to indicate quarter, half, three-quarters, full and charging state
|
||||||
internal-suffix: "%";
|
internal-suffix: "%";
|
||||||
internal-spacing: true;
|
|
||||||
----
|
----
|
||||||
|
|
||||||
* *Volume*: It uses ALSA to display sound volume in percentage. Example:
|
* *Volume*: It uses ALSA to display sound volume in percentage. Example:
|
||||||
|
|
Loading…
Add table
Reference in a new issue