Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Look at the output of this command in a Terminal window:
Code:
pmset -g batt
Another command to look at is 'cut'.

With a percentage number, the shell is capable of doing arithmetic and comparisons. Refer to the man page for your preferred shell.

Other languages would also work. Some of the Mac's builtin ones include awk, AppleScript (osascript cmd), perl, and Python. I'm sure I've omitted some.

Here's an article on using notifications from the command line:

Search terms: mac command line notification

MR's Programming forum is here:
 
Look at the output of this command in a Terminal window:
Code:
pmset -g batt
Another command to look at is 'cut'.

With a percentage number, the shell is capable of doing arithmetic and comparisons. Refer to the man page for your preferred shell.

Other languages would also work. Some of the Mac's builtin ones include awk, AppleScript (osascript cmd), perl, and Python. I'm sure I've omitted some.

Here's an article on using notifications from the command line:

Search terms: mac command line notification

MR's Programming forum is here:
Thanks for the info! Will see if I can go forward with it to accomplish what I want..
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.