Git Product home page Git Product logo

Comments (6)

rgcr avatar rgcr commented on May 13, 2024 1

Yea, I think it is more difficult than I had expected.
We can know the fan speed running sudo spindump 1 1 -nofile -stdout | grep -i 'fan speed'
I'll keep looking for information about how to do it natively, there must be something.

from m-cli.

paxperscientiam avatar paxperscientiam commented on May 13, 2024 1

@rgcr If you'd like an average of three samples:

a=($(sudo powermetrics -s smc -n 3 -i 200 |grep -i 'fan' | grep -Eo '[0-9]+'))
echo $'('$(IFS='+';echo "${a[*]// /+}";IFS=$' \t\n')$')/3' | bc
# OR math like this without bc:
echo $(( ($(IFS='+';echo "${a[*]// /+}";IFS=$' \t\n')) / 3))

For a single measurement:

sudo powermetrics -s smc -n 1 -i 200 |grep -i 'fan' | grep -Eo '[0-9]+'

I can make a PR if you like this approach, but let me know which you prefer.

EDIT: One caveat, it seems that both powermetrics and sysctl are limited when running off of battery power.

EDIT2: Third way (single value)

sudo powermetrics -s smc -n 1 -i 200 -f plist | plutil -extract 'smc.fan' xml1 -o - - | plutil -p -

from m-cli.

rgcr avatar rgcr commented on May 13, 2024

Good idea, I think it should be easy

from m-cli.

pbnj avatar pbnj commented on May 13, 2024

@rgcr - I've done some research and I can't seem to find any evidence that this is possible natively.

The closest thing I found were a few third-party apps and one ruby app (iStats) that leverages this C project.

Either way, seems like you would need to rely on third-party dependencies to achieve this.

from m-cli.

bensleveritt avatar bensleveritt commented on May 13, 2024

Thanks to @paxperscientiam we have fan speed, waiting to be released.

As this issue has been around a long time, I'll close for now. If we find a way to do the other items, we'll open issues/PRs for them separately

from m-cli.

paxperscientiam avatar paxperscientiam commented on May 13, 2024

@bensleveritt awesome!!

from m-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.