1
0
bot/src/ascii.rs

206 lines
146 KiB
Rust
Raw Normal View History

2023-10-20 14:31:16 +00:00
use sysinfo::System;
pub fn c_ascii(x: &str) {
let logo = "
";
let avatar = "
";
let color = "








































";
let avatar_color = "








































";
let mut sys = System::new_all();
sys.refresh_all();
let s = x.to_string();
match &*s {
"logo" => println!("{}", logo),
"color" => println!("{}", color),
"avatar" => println!("{}", avatar),
"avatar_color" => println!("{}", avatar_color),
"os" => println!("{}\n\t", color),
_ => println!("not matched"),
}
println!("total memory: {} bytes", sys.total_memory());
println!("System name: {:?}", System::name().unwrap());
println!(
"System kernel version: {:?}",
System::kernel_version().unwrap()
);
//println!("System OS version: {:?}", System::os_version().unwrap());
println!(
"System host name: {:?}",
System::host_name().unwrap()
);
println!("NB CPUs: {}", sys.cpus().len());
//let disks = Disks::new_with_refreshed_list();
//for disk in &disks {
// println!("{disk:?}");
//}
//let networks = Networks::new_with_refreshed_list();
//println!("=> networks:");
//for (interface_name, data) in &networks {
// println!("{interface_name}: {}/{} B", data.received(), data.transmitted());
//}
//let components = Components::new_with_refreshed_list();
//println!("=> components:");
//for component in &components {
// println!("{component:?}");
//}
}