Crate statusline

Source
Expand description

Status line for shells with ANSI escape sequences support

This is a documentation for statusline API, use README.md for executable documentation

§Example

Default statusline as a readline prompt generator:

use statusline::{default, Environment, IconMode, Style};

let mode = IconMode::build();
let args = Environment::from_env::<&str>(&[]);
let top = default::extend(default::top(&args));
let bottom = default::bottom(&args);

// Top line is not intended to use in readline-like environments
eprintln!("{}", default::pretty(&top, &mode));

// But bottom line is --- because it has "invisibility"
print!(
    "{}{}",
    default::title(&args).invisible(),
    default::pretty(&bottom, &mode)
);

Modules§

default
Default top and bottom statuslines with default title generator
file
workgroup

Structs§

Environment
Environment variables available to statusline
Styled
Styled “string”-like object

Enums§

BlockType
All available statusline block types
Chassis
Chassis type, according to hostnamectl
IconMode
Icon mode configurer

Traits§

Extend
Simple block which can be extended (only once) and pretty-printed
Icon
Associated icon getter, which respects icon mode
Pretty
Pretty formatter with respect to selected icon mode
Style
Styling functions for function chaining