[package] name = "qfetch" version = "1.0.0" edition = "2021" [dependencies] sysinfo = "0.30" whoami = "1.4"
}
fn get_resolution() -> String { if cfg!(target_os = "windows") { let output = Command::new("wmic") .args(&["path", "Win32_VideoController", "get", "CurrentHorizontalResolution,CurrentVerticalResolution"]) .output(); if let Ok(out) = output { let stdout = String::from_utf8_lossy(&out.stdout); let lines: Vec<&str> = stdout.lines().collect(); if lines.len() > 1 { let parts: Vec<&str> = lines[1].split_whitespace().collect(); if parts.len() >= 2 { return format!("{}x{}", parts[0], parts[1]); } } } } else if cfg!(target_os = "linux") let output = Command::new("xrandr").arg("--current").output(); if let Ok(out) = output let stdout = String::from_utf8_lossy(&out.stdout); for line in stdout.lines() if line.contains(" connected") && line.contains('x') &w new desktop command