cjbassi / ytop

A TUI system monitor written in Rust
MIT License
2.16k stars 84 forks source link

Temperatures don't show up. #77

Open iliyan61 opened 4 years ago

iliyan61 commented 4 years ago

Using this on a 5.1 Mac Pro over SSH and the temps don't show up but they show up for a Mac mini over SSH

Zarathustra2 commented 4 years ago

Could you maybe try the following:

In line 68 of src/widgets/temp.rs could you change it to:

+ let mut sys = System::new_all();
+ sys.refresh_all();
- let sys = System::new_all();
Zarathustra2 commented 4 years ago

Otherwise it could be an issue with the following library: sysinfo as this library is used to get the temperature on mac os.

Zarathustra2 commented 4 years ago

Could you please run the following on your mac pro @iliyan61 :

// main.rs

use sysinfo::{ComponentExt, System, SystemExt};

fn main() {
    let mut sys = System::new_all();
    sys.refresh_all();
    let sensor_data = sys.get_components();

    println!("Components: {}", sensor_data.len());

    for component in sensor_data {
        println!("{}: {}", component.get_label().to_string(), component.get_temperature());
    }
}
# Cargo.toml
[dependencies]
sysinfo = "0.14.1"
iliyan61 commented 4 years ago

I can't find this directory. I installed thru hombrew but using ls I couldn't find a src folder under it what's the directory I need to access?

Zarathustra2 commented 4 years ago

Homebrew only installs the binary, so you cannot find the directory.

If you clone the repo, you would be able to edit it, but I guess without knowledge of rust this is kinda hard :(