New Desktop Command Online

#[derive(Debug)] struct SystemInfo os: String, host: String, kernel: String, uptime: String, shell: String, cpu: String, gpu: String, memory: String, disk: String, resolution: String, desktop: String,

// Disk (root partition) let mut disk_info = "N/A".to_string(); for disk in sys.disks() { if cfg!(target_os = "windows") && disk.mount_point().to_str() == Some("C:") || cfg!(target_os = "linux") && disk.mount_point().to_str() == Some("/") || cfg!(target_os = "macos") && disk.mount_point().to_str() == Some("/") { let total = disk.total_space() / (1024 * 1024 * 1024); let available = disk.available_space() / (1024 * 1024 * 1024); let used = total - available; disk_info = format!("{} GiB / {} GiB", used, total); break; } } new desktop command

fn display(info: &SystemInfo) { let ascii_art = r#" ╔══════════════════════╗ ║ ██ ║ ║ ████ ║ ║ ██████ ║ ║ ████████ ║ ║ ██████████ ║ ║ ██ ██████ ██ ║ ║ ██ ████ ██ ║ ║ ██ ██ ██ ║ ╚══════════════════════╝ "#; #[derive(Debug)] struct SystemInfo os: String

println!("\x1b[36m{}\x1b[0m", ascii_art); println!("\x1b[1;32m qfetch v{}\x1b[0m\n", VERSION); let used = total - available

let entries = vec![ ("OS", &info.os), ("Host", &info.host), ("Kernel", &info.kernel), ("Uptime", &info.uptime), ("Shell", &info.shell), ("DE/WM", &info.desktop), ("CPU", &info.cpu), ("GPU", &info.gpu), ("Memory", &info.memory), ("Disk (/)", &info.disk), ("Resolution", &info.resolution), ];