silver 2.0.0

A cross-shell customizable powerline-like prompt with icons
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::Segment;
use sysinfo::{get_current_pid, ProcessExt, System, SystemExt};

pub fn segment(segment: &mut Segment, _: &[&str]) {
    let sys = System::new_all();
    segment.value = sys
        .get_process(
            sys.get_process(get_current_pid().unwrap())
                .unwrap()
                .parent()
                .unwrap(),
        )
        .unwrap()
        .name()
        .to_string();
}