auraline 0.16.0

utility that renders information into a string suitable to be embedded in the shell prompt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{
    chunk::{Adjoin, Chunk},
    options::Options,
};
use smol_str::{format_smolstr, SmolStr};

pub async fn show(opts: &Options) -> Option<Chunk<Adjoin<&'static str, SmolStr>>> {
    if !opts.load {
        return None;
    }
    let avg = sysinfo::System::load_average();
    Some(Chunk::info(Adjoin((
        "λ",
        format_smolstr!("{:.2}", avg.one),
    ))))
}