feat(about): show kernel version
This commit is contained in:
parent
e700589e17
commit
b49f1d4bfe
4 changed files with 20 additions and 0 deletions
|
|
@ -244,6 +244,7 @@ fn os() -> Section<crate::pages::Message> {
|
||||||
|
|
||||||
let os = descriptions.insert(fl!("about-os", "os"));
|
let os = descriptions.insert(fl!("about-os", "os"));
|
||||||
let os_arch = descriptions.insert(fl!("about-os", "os-architecture"));
|
let os_arch = descriptions.insert(fl!("about-os", "os-architecture"));
|
||||||
|
let kernel = descriptions.insert(fl!("about-os", "kernel"));
|
||||||
let desktop = descriptions.insert(fl!("about-os", "desktop-environment"));
|
let desktop = descriptions.insert(fl!("about-os", "desktop-environment"));
|
||||||
let windowing_system = descriptions.insert(fl!("about-os", "windowing-system"));
|
let windowing_system = descriptions.insert(fl!("about-os", "windowing-system"));
|
||||||
|
|
||||||
|
|
@ -262,6 +263,10 @@ fn os() -> Section<crate::pages::Message> {
|
||||||
&*desc[os_arch],
|
&*desc[os_arch],
|
||||||
text::body(&page.info.os_architecture),
|
text::body(&page.info.os_architecture),
|
||||||
))
|
))
|
||||||
|
.add(settings::flex_item(
|
||||||
|
&*desc[kernel],
|
||||||
|
text::body(&page.info.kernel_version),
|
||||||
|
))
|
||||||
.add(settings::flex_item(
|
.add(settings::flex_item(
|
||||||
&*desc[desktop],
|
&*desc[desktop],
|
||||||
text::body(&page.info.desktop_environment),
|
text::body(&page.info.desktop_environment),
|
||||||
|
|
|
||||||
1
i18n/de/cosmic_settings.ftl
vendored
1
i18n/de/cosmic_settings.ftl
vendored
|
|
@ -785,6 +785,7 @@ about-hardware = Hardware
|
||||||
about-os = Betriebssystem
|
about-os = Betriebssystem
|
||||||
.os = Betriebssystem
|
.os = Betriebssystem
|
||||||
.os-architecture = Betriebssystemarchitektur
|
.os-architecture = Betriebssystemarchitektur
|
||||||
|
.kernel = Kernel Version
|
||||||
.desktop-environment = Desktopumgebung
|
.desktop-environment = Desktopumgebung
|
||||||
.windowing-system = Fenstersystem
|
.windowing-system = Fenstersystem
|
||||||
about-related = Zugehörige Einstellungen
|
about-related = Zugehörige Einstellungen
|
||||||
|
|
|
||||||
1
i18n/en/cosmic_settings.ftl
vendored
1
i18n/en/cosmic_settings.ftl
vendored
|
|
@ -882,6 +882,7 @@ about-hardware = Hardware
|
||||||
about-os = Operating system
|
about-os = Operating system
|
||||||
.os = Operating system
|
.os = Operating system
|
||||||
.os-architecture = Operating system architecture
|
.os-architecture = Operating system architecture
|
||||||
|
.kernel = Kernel version
|
||||||
.desktop-environment = Desktop environment
|
.desktop-environment = Desktop environment
|
||||||
.windowing-system = Windowing system
|
.windowing-system = Windowing system
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ pub struct Info {
|
||||||
pub memory: String,
|
pub memory: String,
|
||||||
pub operating_system: String,
|
pub operating_system: String,
|
||||||
pub os_architecture: String,
|
pub os_architecture: String,
|
||||||
|
pub kernel_version: String,
|
||||||
pub processor: String,
|
pub processor: String,
|
||||||
pub windowing_system: String,
|
pub windowing_system: String,
|
||||||
}
|
}
|
||||||
|
|
@ -37,6 +38,9 @@ impl Info {
|
||||||
architecture(&bump, &mut info.os_architecture);
|
architecture(&bump, &mut info.os_architecture);
|
||||||
bump.reset();
|
bump.reset();
|
||||||
|
|
||||||
|
kernel_version(&bump, &mut info.kernel_version);
|
||||||
|
bump.reset();
|
||||||
|
|
||||||
hardware_model(&bump, &mut info.hardware_model);
|
hardware_model(&bump, &mut info.hardware_model);
|
||||||
bump.reset();
|
bump.reset();
|
||||||
|
|
||||||
|
|
@ -116,6 +120,15 @@ pub fn architecture(bump: &Bump, arch: &mut String) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn kernel_version(bump: &Bump, kernel: &mut String) {
|
||||||
|
let buffer = &mut bumpalo::collections::Vec::new_in(bump);
|
||||||
|
if let Some(value) = read_to_string("/proc/version", buffer) {
|
||||||
|
if let Some(version) = value.split_whitespace().nth(2) {
|
||||||
|
kernel.push_str(version.trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn hardware_model(bump: &Bump, hardware_model: &mut String) {
|
pub fn hardware_model(bump: &Bump, hardware_model: &mut String) {
|
||||||
let buffer = &mut bumpalo::collections::Vec::new_in(bump);
|
let buffer = &mut bumpalo::collections::Vec::new_in(bump);
|
||||||
if let Some(mut sys_vendor) = read_to_string(SYS_VENDOR, buffer) {
|
if let Some(mut sys_vendor) = read_to_string(SYS_VENDOR, buffer) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue