2024-08-03 17:42:48 +00:00
|
|
|
mod colors;
|
|
|
|
mod desktop;
|
|
|
|
mod release;
|
|
|
|
mod system;
|
|
|
|
mod uptime;
|
|
|
|
|
2024-08-03 17:00:58 +00:00
|
|
|
use color_eyre::{Report, Result};
|
2024-08-03 16:06:29 +00:00
|
|
|
|
2024-08-03 17:42:48 +00:00
|
|
|
use crate::colors::{BLUE, CYAN, RESET};
|
|
|
|
use crate::desktop::get_desktop_info;
|
|
|
|
use crate::release::{get_os_pretty_name, get_system_info};
|
2024-08-03 17:56:02 +00:00
|
|
|
use crate::system::{get_memory_usage, get_root_disk_usage, get_username_and_hostname};
|
2024-08-03 17:42:48 +00:00
|
|
|
use crate::uptime::get_system_uptime;
|
2024-08-03 16:06:29 +00:00
|
|
|
|
2024-08-03 17:00:58 +00:00
|
|
|
fn main() -> Result<(), Report> {
|
|
|
|
color_eyre::install()?;
|
|
|
|
|
2024-08-03 16:06:29 +00:00
|
|
|
let user_info = get_username_and_hostname().expect("Failed to get username and hostname");
|
|
|
|
let os_name = get_os_pretty_name().expect("Failed to get OS name");
|
2024-08-03 17:00:58 +00:00
|
|
|
let kernel_version = get_system_info().expect("Failed to get kernel info");
|
2024-08-03 16:06:29 +00:00
|
|
|
let uptime = get_system_uptime().expect("Failed to get uptime");
|
|
|
|
let window_manager = get_desktop_info().expect("Failed to get desktop info");
|
|
|
|
let memory_usage = get_memory_usage().expect("Failed to get memory usage");
|
2024-08-03 17:56:02 +00:00
|
|
|
let storage = get_root_disk_usage().expect("Failed to get storage info");
|
2024-08-03 16:06:29 +00:00
|
|
|
|
|
|
|
// Construct the ASCII art with dynamic OS name
|
2024-08-03 17:00:58 +00:00
|
|
|
|
|
|
|
println!(
|
2024-08-03 16:06:29 +00:00
|
|
|
"
|
|
|
|
{CYAN} ▗▄ {BLUE}▗▄ ▄▖ {} ~{RESET}
|
2024-08-03 17:56:02 +00:00
|
|
|
{CYAN} ▄▄🬸█▄▄▄{BLUE}🬸█▛ {CYAN}▃ {CYAN} {BLUE}System{RESET} {}
|
|
|
|
{BLUE} ▟▛ ▜{CYAN}▃▟🬕 {CYAN} {BLUE}Kernel{RESET} {}
|
|
|
|
{BLUE}🬋🬋🬫█ {CYAN}█🬛🬋🬋 {CYAN} {BLUE}Uptime{RESET} {}
|
|
|
|
{BLUE} 🬷▛🮃{CYAN}▙ ▟▛ {CYAN} {BLUE}WM{RESET} {}
|
|
|
|
{BLUE} 🮃 {CYAN}▟█🬴{BLUE}▀▀▀█🬴▀▀ {CYAN} {BLUE}Memory{RESET} {}
|
|
|
|
{CYAN} ▝▀ ▀▘ {BLUE}▀▘ {CYAN} {BLUE}Storage (/){RESET} {}
|
2024-08-03 16:06:29 +00:00
|
|
|
",
|
|
|
|
user_info, os_name, kernel_version, uptime, window_manager, memory_usage, storage
|
|
|
|
);
|
|
|
|
|
2024-08-03 17:00:58 +00:00
|
|
|
Ok(())
|
2024-08-03 16:06:29 +00:00
|
|
|
}
|