mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-03 06:38:52 +00:00
feat: add cpu to debug info
This commit is contained in:
parent
4767a4eb13
commit
eef963793d
1 changed files with 20 additions and 6 deletions
|
@ -30,6 +30,8 @@ pub fn create_about_dialog() -> adw::AboutDialog {
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const UNKNOWN: &str = "UNKNOWN";
|
||||||
|
|
||||||
pub fn populate_debug_info(dialog: &adw::AboutDialog, vkinfo: Option<&VulkanInfo>) {
|
pub fn populate_debug_info(dialog: &adw::AboutDialog, vkinfo: Option<&VulkanInfo>) {
|
||||||
if dialog.debug_info().len() > 0 {
|
if dialog.debug_info().len() > 0 {
|
||||||
return;
|
return;
|
||||||
|
@ -42,10 +44,10 @@ pub fn populate_debug_info(dialog: &adw::AboutDialog, vkinfo: Option<&VulkanInfo
|
||||||
format!("Build time: {BUILD_DATETIME}"),
|
format!("Build time: {BUILD_DATETIME}"),
|
||||||
format!(
|
format!(
|
||||||
"Operating system: {d} ({f})",
|
"Operating system: {d} ({f})",
|
||||||
d = distro.unwrap_or("unknown".into()),
|
d = distro.unwrap_or(UNKNOWN.into()),
|
||||||
f = distro_family
|
f = distro_family
|
||||||
.map(|f| f.to_string())
|
.map(|f| f.to_string())
|
||||||
.unwrap_or("unknown".into())
|
.unwrap_or(UNKNOWN.into())
|
||||||
),
|
),
|
||||||
format!(
|
format!(
|
||||||
"Kernel: {}",
|
"Kernel: {}",
|
||||||
|
@ -55,23 +57,35 @@ pub fn populate_debug_info(dialog: &adw::AboutDialog, vkinfo: Option<&VulkanInfo
|
||||||
),
|
),
|
||||||
format!(
|
format!(
|
||||||
"Session type: {}",
|
"Session type: {}",
|
||||||
env::var("XDG_SESSION_TYPE").unwrap_or("unknown".into())
|
env::var("XDG_SESSION_TYPE").unwrap_or(UNKNOWN.into())
|
||||||
),
|
),
|
||||||
format!(
|
format!(
|
||||||
"Desktop: {}",
|
"Desktop: {}",
|
||||||
env::var("XDG_CURRENT_DESKTOP").unwrap_or("unknown".into())
|
env::var("XDG_CURRENT_DESKTOP").unwrap_or(UNKNOWN.into())
|
||||||
|
),
|
||||||
|
format!(
|
||||||
|
"CPU: {}",
|
||||||
|
read_to_string("/proc/cpuinfo")
|
||||||
|
.ok()
|
||||||
|
.and_then(|s| {
|
||||||
|
s.split("\n")
|
||||||
|
.find(|line| line.starts_with("model name"))
|
||||||
|
.map(|line| line.split(':').last().map(|s| s.trim().to_string()))
|
||||||
|
})
|
||||||
|
.flatten()
|
||||||
|
.unwrap_or(UNKNOWN.into())
|
||||||
),
|
),
|
||||||
format!(
|
format!(
|
||||||
"GPUs: {}",
|
"GPUs: {}",
|
||||||
vkinfo
|
vkinfo
|
||||||
.map(|i| i.gpu_names.join(", "))
|
.map(|i| i.gpu_names.join(", "))
|
||||||
.unwrap_or("unknown".into())
|
.unwrap_or(UNKNOWN.into())
|
||||||
),
|
),
|
||||||
format!(
|
format!(
|
||||||
"Monado Vulkan Layers: {}",
|
"Monado Vulkan Layers: {}",
|
||||||
vkinfo
|
vkinfo
|
||||||
.map(|i| i.has_monado_vulkan_layers.to_string())
|
.map(|i| i.has_monado_vulkan_layers.to_string())
|
||||||
.unwrap_or("unknown".into())
|
.unwrap_or(UNKNOWN.into())
|
||||||
),
|
),
|
||||||
format!("Detected XR Devices: {}", {
|
format!("Detected XR Devices: {}", {
|
||||||
let devs = PhysicalXRDevice::from_usb();
|
let devs = PhysicalXRDevice::from_usb();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue