Question

This question already has an answer here:

How can I get the current battery level using the cocoa framework running with Leopard?

Currently I am getting it running a NSTask with:

pmset -g ps | grep -o -e [0-9]*% | sed -e 's/%//g'

But i think this is a clumsy way of doing this.

Thanks

Was it helpful?

Solution

I believe this question has been asked here before... Here's some links:

Battery status in OSX? (asked here before)

It limited my number of links because I'm new... but you should find more links there

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top