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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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