𝙼
Size: a a a
𝙼
JC
𝙼
JC
D
𝙼
I
I
𝙼
𝙼
D
𝙼
q
D
use std::fs;❯ cargo run
use systemstat::{Platform, System};
fn main() {
match fs::read_to_string("/proc/sys/kernel/hostname") {
Ok(hostname) if hostname.eq("archbook") => match System::new().cpu_temp() {
Ok(cpu_temp) if cpu_temp > 40.0 => println!(" {:?}°", cpu_temp),
_ => println!(""),
},
Ok(hostname) if hostname.eq("archbox") => match System::new().cpu_temp() {
Ok(cpu_temp) if cpu_temp > 40.0 => println!(" {:?}°", cpu_temp),
_ => println!(""),
},
Ok(hostname) => println!("{:?}", hostname),
_ => println!(""),
}
}
target/debug/cpu-temperature
q
Б
q
SS
use std::fs;❯ cargo run
use systemstat::{Platform, System};
fn main() {
match fs::read_to_string("/proc/sys/kernel/hostname") {
Ok(hostname) if hostname.eq("archbook") => match System::new().cpu_temp() {
Ok(cpu_temp) if cpu_temp > 40.0 => println!(" {:?}°", cpu_temp),
_ => println!(""),
},
Ok(hostname) if hostname.eq("archbox") => match System::new().cpu_temp() {
Ok(cpu_temp) if cpu_temp > 40.0 => println!(" {:?}°", cpu_temp),
_ => println!(""),
},
Ok(hostname) => println!("{:?}", hostname),
_ => println!(""),
}
}
target/debug/cpu-temperature
D