wyfyw
V2EX  ›  macOS

M1 Mac 温度监控

  •  
  •   wyfyw · Nov 30, 2020 · 6154 views
    This topic created in 2014 days ago, the information mentioned may be changed or developed.

    项目地址 https://github.com/fermion-star/apple_sensors

    两个单文件代码 temp_sensor.mmonitor.cpp

    核心代码(temp_sensor.m)来自 https://github.com/freedomtan/sensors/blob/master/sensors/sensors.m,感谢作者 https://github.com/freedomtan 。原始代码针对的是 iOS,透过 IOKit 读取传感器。

    为了适配 M1,我做了相应修改。目前只在 M1 的 Mac mini 上进行了测试。

    瞎写了一个命令行界面(monitor.cpp),貌似要先把 Terminal 窗口拉的很长(保证有 50 空行)。效果如下: (温度监控中我打开了一个 8K 的 AV1 视频,部分温度升高了)

    screen record

    Supplement 1  ·  Nov 30, 2020
    发现这个更新温度的界面很傻(纯手工靠 ANSI escape code ),更好的选择貌似是 ncurses.h ?同时在学 SwiftUI 。
    Supplement 2  ·  Dec 1, 2020
    看到一个类似的软件 TG Pro 在这个视频里


    挺有意思的
    wyfyw
        1
    wyfyw  
    OP
       Nov 30, 2020
    目前传感器的名称还没有匹配上具体的硬件(可以参考开源项目 stats 对 intel mac 传感器的列表 https://github.com/exelban/stats/blob/master/Modules/Sensors/values.swift ),而且因为 M1 的功耗控制很好,目前观察温度并没有啥用处。

    可能 Macbook Air 用户,长时间高负载的时候可以看看乐乐。
    guisheng
        2
    guisheng  
       Nov 30, 2020
    虽然我不需要,但是还是要为创作者点个赞。
    FurN1
        3
    FurN1  
       Nov 30, 2020 via iPhone
    赞大神!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   840 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 20:59 · PVG 04:59 · LAX 13:59 · JFK 16:59
    ♥ Do have faith in what you're doing.