#status-bar #display #xlib #config-file #input #system #line

bin+lib unibar

Simple minimal status bar, written with Xlib in rust

3 releases

0.1.3 Nov 7, 2020
0.1.2 Oct 31, 2020
0.1.1 Sep 20, 2020
0.1.0 Sep 20, 2020

#512 in Configuration

MIT license

83KB
1.5K SLoC

Unibar

Simple Xorg display bar written for speed and ease of use.

CLI Interface

Required Arg

  • [[NAME]] ---> Used to find config file, also used to create unique WMNAME.

Flags

  • -H, --help ---> Display help info
  • -V, --version ---> Display version info
  • -C, --noconfig ---> Do not try to load a conifg file, only use cli options.

Options

  • -c, --config ---> Specify custom config file to use.

  • -p, --position ---> Choose bar position, options are TOP or BOTTOM.

  • -m, --monitor ---> Monitor to use: can either be the Xrandr monitor name, or a number. If value is a number it is used to index the Xinerama displays. Valid index starts at 0.

  • -h, --height ---> Choose bar height in pixels.

  • -u, --underline ---> Choose underline highlight height in pixels.

  • -b, --background ---> Choose default bg colour in '#XXXXXX' hex format.

  • -y, --fonty ---> Choose font offset from top of bar in pixels.

  • -f, --fonts ... ---> Comma seperated list of FcConfig font name strings. Ex. 'FontName:size=XX:antialias=true/false'

  • -F, --ftcolours ... ---> Comma seperated list of font colours in '#XXXXXX' hex format.

  • -B, --bgcolours ... ---> Comma seperated list of background highlight colours in '#XXXXXX' hex format.

  • -U, --ulcolours ... ---> Comma seperated list of underline highlight colours in '#XXXXXX' hex format.

Configuration

The bar looks for the config file at:

  • $XDGCONFIGDIR/unibar/[[NAME]].conf OR
  • ~/.config/unibar/[[NAME]].conf

Defaults

Any configuration options set with command line arguements override options set in the config file. The default config file provided lays out the default options for configuration and how to override them.

Usage

The bar is only used to display text provided to it on stdin. Input is read and displayed everytime a new line is output. So make sure to use echo -n or some other print method that does not end in newline until you are ready to refresh the bar. Text written to the bar can also include formatting blocks with the following format.

Formatting

All formatting blocks are enclosed in curly braces {}. All closing blocks are enclosed in curly braces and start with the slash {/}.

  • {fi} {/f} => all characters within the blocks will be printed with the font face at index i.
  • {Fi} {/F} => all characters within the blocks will be printed with the font colour at index i.
  • {Bi} {/B} => all characters within the blocks will have a background highlight behind them with the btcolour at index i.
  • {Hi} {/H} => all characters within the blocks will have an underline highlight behind them with the htcolour at index i.

Splitting Input

There is only one special block the is not in curly braces. The splitting block is <|> and seperates between the left, right, and center displays.

  • 0 splitting blocks => the whole string will be considered left-adjusted.
  • 1 splitting block => the part of the string before the block will be left-adjusted and everything else will be right-adjusted.
  • 2 or more splitting blocks => the part of the string before the first block will be left-adjusted the part between the first and second will be center-adjusted and everything between the second and third will be right-adjusted. Any other splitting blocks and their strings will be ignored.

Example

The bar running on my system by default, set up using the scripts in the files repo.

Screenshot

Installation

The project has been uploaded to crates.io and can be downloaded with:

cargo install unibar

Author

By: Curtis Jones <mail@curtisjones.ca>

Dependencies

~2–2.8MB
~42K SLoC