Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

tigattack/macOS-hardware-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macOS Hardware Stats

Get CPU & GPU temperatures and fan and battery statistics from your Mac.

This simple script will output a JSON array containing hardware statistics from your Mac.

Prerequisites

  • Install sensei. brew install drpsychick/sensei/sensei
  • Install the smc binary.
    • Method 1:
      • Copy the smc file to /usr/local/bin or your preferred location. You can specify the path with the --smc-path argument.
      • Run chmod +x /usr/local/bin/smc
    • Method 2:
      • Compile smc from the included source (original source here):
        cd ./smc-command_src
        make
        make install

Usage

./stats.py [-h] [--collection {all,temps} | --component {cpu,gpu,fans,battery} --fan {0,1}] [--smc-path SMC_PATH] [--sensei-path SENSEI_PATH]

Argument Description
-h, --help Show help message.
-l, --collection The collection to query. Defaults to all.
Collections:
- all: Query supported statistics.
- temperatures: Query all supported temperature statistics.
-c, --component The component to query.
Components:
- cpu: Query supported CPU statistics.
- gpu: Query supported GPU statistics.
- fans: Query supported fan statistics.
- battery: Query supported battery statistics.
-f, --fan Fan number to query. Can ONLY be used with '{--component,-c} fans' argument. Defaults to all.
Fans:
- 0: Left
- 1: Right
- all: Query all fans.

Example: ./stats.py
Output: {"cpu": {"temperature": 76.9}, "gpu": {"temperature": 69.0}, "fans": [{"current_speed": 4437.0, "current_speed_pct": 60.4, "min_rpm": 2160, "max_rpm": 5927, "side": "left", "id": 0}, {"current_speed": 4079.0, "current_speed_pct": 59.5, "min_rpm": 2000, "max_rpm": 5489, "side": "right", "id": 1}]}

About

Get CPU & GPU temperatures and fan and battery statistics from your Mac.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published