lesbar(1)

πŸ“¦
version 1.1.0 Β· 2 versions
, in nixos 26.05

🌸 NAME 🌸

okay so bestie, this is the lesbar(1) page from the General Commands Manual, and lesbar is a programming language agnostic view layer for creating desktop widgets and status bars. fr fr it reads lines written in the markup language described below from standard input and displays a rendered view of the most recent line read in a borderless window. the whole idea is that a program can generate a stream of markup strings, pass them to lesbar, and lesbar takes care of the rendering. iconic behavior πŸ’…βœ¨


✨ SYNOPSIS ✨

lesbar [-geometry WIDTHxHEIGHT+XOFF+YOFF] [-help] [-version]

πŸŽ€ DESCRIPTION πŸŽ€

okay so picture this: lesbar is a programming language agnostic view layer for making desktop widgets and status bars. it reads lines written in the markup language below from standard input and shows a rendered view of the most recent line read in a borderless window. that's the vibe. the idea is literally that a program can generate a stream of markup strings and pass them to lesbar, and lesbar will handle all the rendering for you. no cap, it's giving "your program makes the words, lesbar makes them cute" πŸ¦‹


πŸ’– OPTIONS πŸ’–

  • -geometry WIDTHxHEIGHT+XOFF+YOFF β€” define the window geometry. similar to the format described in X(7). +XOFF and +YOFF offset the window from the left or the top of the screen respectively. -XOFF and -YOFF instead place the window offset from the right or the bottom. WIDTH and HEIGHT can be either a number or "fit". when you use "fit", the window resizes itself dynamically to fit the content. slay 🫢
  • -reserve-space left|right|top|bottom β€” reserve space on the edge of the screen.
  • -help β€” print help message and exit.
  • -version β€” print version information and exit.

πŸ¦‹ MARKUP LANGUAGE πŸ¦‹

lesbar uses a markup language somewhat similar to XML. views are defined using blocks, which are parts of the text enclosed in an opening tag (<>) and a closing tag (</>). blocks may contain any lesbar markup. the opening tag may contain a comma-separated list of attributes in the form "attribute:value". if an attribute is not specified, its value will be set to the default value of that attribute. iykyk πŸ’«

for example, the following input line will result in the text "Hello World!" printed on a black background with the "World" printed in green:

<b:#ff000000>Hello <f:#ff00ff00>World</>!</>

if a literal < should be included in the content of the block, it can be escaped with a backslash. important little detail, bestie πŸ™ˆ


🌈 FORMATTING ATTRIBUTES 🌈

  • b: COLOR β€” sets the background color in #aarrggbb format. default value: #ffffffff
  • c[1-5]: 'STRING' β€” makes the block clickable. STRING will be printed to stdout when the block is clicked. the attribute name determines the mouse button. (use c1 for left mouse button, c3 for right mouse, etc). single quotes in the string can be escaped with a backslash. unset by default.
  • f: COLOR β€” sets the text color in #aarrggbb format. default value: #ffffffff
  • t: 'TYPEFACE' β€” sets the font. TYPEFACE is interpreted as a pango font description string. single quotes in the string can be escaped with a backslash. default value: 'Sans 11'
  • w: SIZE β€” sets the width of the block. SIZE is either a number or one of the special values fit and fill. for details see BUILDING LAYOUTS. default value: fit
  • h: SIZE β€” sets the height of the block. SIZE is either a number or one of the special values fit and fill. for details see BUILDING LAYOUTS. default value: fit
  • d: x | y | z β€” sets the direction in which the children of this block are laid out. for details see HIGHER-DIMENSIONAL LAYOUTS. default value: x

πŸŽ€ BUILDING LAYOUTS πŸŽ€

the text and blocks inside a block are laid out from left to right by default. the position and alignment of text is controlled using other, often empty, blocks around it and changing their width and height attributes. it's giving layout tetris πŸ’…

by default, or when width (or height) is set explicitly to "fit", a block is just wide (or high) enough to fit all of its children.

if the width or height is set to "fill", the block will expand as much as possible in that direction, filling the remaining space left in its parent block. if there are multiple "filling" blocks, the remaining space is distributed between them evenly. this is useful for aligning text. for example, to align text to the right, you can place a "fill" block in front of it:

<w:fill></>This text is right-aligned.

each of the following examples will be accompanied with an illustration of the output with the blocks and text bounding boxes visualized and the outermost border representing the window:

           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
           β”‚β”‚                           β”‚β”‚This text is right-alignedβ”‚β”‚
           β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

for centering text, place "fill" blocks around it:

<w:fill></>This text is centered<w:fill></>
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
           β”‚β”‚               β”‚β”‚This text is centeredβ”‚β”‚               β”‚β”‚
           β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

this example creates a common layout with one section aligned to the left, one in the middle and one to the right:

<w:fill>left</>center<w:fill><w:fill></>right</>
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
           β”‚β”‚β”Œβ”€β”€β”€β”€β”                β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”β”‚β”‚
           β”‚β”‚β”‚leftβ”‚                β”‚β”‚center β”‚β”‚β”‚             β”‚β”‚rightβ”‚β”‚β”‚
           β”‚β”‚β””β”€β”€β”€β”€β”˜                β”‚β””β”€β”€β”€β”€β”€β”€β”€β”˜β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”˜β”‚β”‚
           β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

the width and height can also be a fixed size in pixels. this can for example be used to introduce padding around a block of text:

<b:#ff000000><w:8></>Content with padding.<w:8></></>
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                        β”‚
           β”‚β”‚β”Œβ”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”β”‚                        β”‚
           β”‚β”‚β”‚  β”‚β”‚Content with padding.β”‚β”‚  β”‚β”‚                        β”‚
           β”‚β”‚β””β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”˜β”‚                        β”‚
           β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                        β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🧚 HIGHER-DIMENSIONAL LAYOUTS 🧚

the direction in which child blocks are laid out can be controlled by setting the d attribute on the parent. a block with d:x will have the children laid out from left to right, a block with d:y from top to bottom. a block with d:z will cause the children to be layered on top of each other. children are always centered in the directions orthogonal to the parent's d value. not me getting emotional over axes 😭

using these primitives, all sorts of more advanced layouts and effects can be constructed. for example, this markup creates an A with a red underline:

<d:z><h:fill,w:fill,d:y><h:fill></><w:fill,h:1,b:#ffff0000></></>A</>

ate. periodt. πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

meipp (meipp@protonmail.com), Thilo Wischmeyer (thwischm@gmail.com)

the source code can be found at https://git.sr.ht/~salmiak/lesbar. please send bug reports or patches by email to ~salmiak/lesbar@lists.sr.ht. support the icons, bestie πŸ’œ


okay that's the whole lesbar(1) manual, bestie! this page is dated 1980-01-01 and it's the lesbar(1) manual from the General Commands Manual. now go render something iconic πŸŒˆπŸ’…πŸŽ€

πŸ“¦ where this page comes from