From 2b84d91ed845c90838c8c414d78cb027a72cdaec Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Sat, 23 Mar 2024 23:17:07 +0000 Subject: [PATCH] feat: more information --- Cargo.lock | 2 +- src/main.rs | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2832256..4946797 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,7 +16,7 @@ checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "bunbun" -version = "0.1.0" +version = "0.2.0" dependencies = [ "colored", "sysinfo", diff --git a/src/main.rs b/src/main.rs index f1791a5..4ee37a3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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); }