feat: add kernel to troubleshooting info

This commit is contained in:
Gabriele Musco 2024-08-05 13:45:33 +02:00
commit 2e05580f36

View file

@ -9,7 +9,7 @@ use crate::{
xdg::XDG,
};
use relm4::prelude::*;
use std::env;
use std::{env, fs::read_to_string};
pub fn create_about_dialog() -> adw::AboutDialog {
adw::AboutDialog::builder()
@ -41,6 +41,12 @@ pub fn populate_debug_info(dialog: &adw::AboutDialog) {
.map(|f| f.to_string())
.unwrap_or("unknown".into())
),
format!(
"Kernel: {}",
read_to_string("/proc/version")
.unwrap_or("Unable to read /proc/version".into())
.trim()
),
format!(
"Session type: {}",
env::var("XDG_SESSION_TYPE").unwrap_or("unknown".into())