feat: more information

This commit is contained in:
Muhammad Nauman Raza 2024-03-23 23:17:07 +00:00
parent 72427195dc
commit 2b84d91ed8
Signed by: devraza
GPG key ID: 91EAD6081011574B
2 changed files with 13 additions and 4 deletions

2
Cargo.lock generated
View file

@ -16,7 +16,7 @@ checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa"
[[package]]
name = "bunbun"
version = "0.1.0"
version = "0.2.0"
dependencies = [
"colored",
"sysinfo",

View file

@ -7,6 +7,13 @@ fn main() {
let bottom = format!("c({})({})", "\"".red(), "\"".red()).to_string();
let ascii = vec!["(\\ /)", "( . .)", &bottom];
let hostname = fallible::hostname().unwrap_or(String::from("N/A"));
let user = env!("USER");
let arch = arch();
let combined = format!("{}@{}", user, hostname);
let kernel = System::kernel_version().unwrap_or(String::from("N/A"));
let pretty = distro();
let wm: &str;
@ -19,7 +26,9 @@ fn main() {
wm = "N/A";
}
println!(" {} {} {}", ascii[0], "Kernel".red(), kernel);
println!(" {} {} {}", ascii[1], "WM".green(), wm);
println!(" {} {} {}", ascii[2], "OS".blue(), pretty);
println!("{:>34}", combined.magenta().bold());
println!("{:>19} {}", "Arch".cyan(), arch);
println!("{:>9} {:>11} {}", ascii[0], "Kernel".red(), kernel);
println!("{:>10} {:>6} {}", ascii[1], "WM".green(), wm);
println!("{:>29} {:>5} {}", ascii[2], "OS".blue(), pretty);
}