4

I installed the update to Mavericks a few days ago, and while it's mostly been great there is no longer a sound that goes with the low battery warning. I have several programs which suppress the visual notifications, which makes for very unpleasant interruptions when the machine goes into standby.

I contacted Apple support about it and they said that there is no way to add a sound to the notification using settings available in the operating system. They suggested I use a 3rd party app, but although I have found some which offer low battery pop up windows, I'm having trouble finding any offering an audible alert.

2
  • There's "no longer" a sound for a low battery warning? Was there ever one in the first place? (Serious question: I've never heard of such a feature).
    – daGUY
    Commented Feb 12, 2014 at 1:08
  • Yes, "no longer". It's been a while since I set up my computer initially, so I don't know if I had to activate it manually or if it was the default, but it made that short system buzzer sound.
    – Crowbeak
    Commented Feb 13, 2014 at 2:38

4 Answers 4

2

You could write a short script and run it via cron every couple of minutes.

pmset -g batt

Running the above will show your current battery usage. You can then parse it out and you can make it alert you with something like:

say "low battery power"

That will speak out "low battery power. Or to make it beep:

printf "\a"

I have a desktop, so can't see the pmset output, a quick google shows something like this would do it:

if [[ `pmset -g batt | awk -F'[^0-9]*' '{ print $3 }'` -lt 10 ]];then say "Battery low";fi

You can put that into a cron to run every 5 mins or so.

To add this to cron to run every 5 minutes, do:

crontab -e

and type in a line that looks like this:

*/5  *  *  *  *  if [[ `pmset -g batt | awk -F'[^0-9]*' '{ print $3 }'` -lt 10 ]];then say "Battery low";fi

Then save and exit. The crontab editor will be whichever is set as your default editor in $EDITOR. For me that vim, default OSX it's nano.

crontab -l

That lists out your crontab. For more info see: enter link description here

To use launchd, you'd be better off putting that into a shell script, then putting a launchd plist file in your ~/Library/LaunchDaemons folder. That's somewhat out of scope of this answer, Lingon is a great tool to control LaunchD files. See LaunchD for more information. You shell script would be be the same command as used above, with

#!/bin/sh

as the first line. Save it somewhere, make LaunchD run it.

1
  • This seems like a solution along the lines I'm looking for, but I'm having trouble finding good information about how to use cron (or launchd, as my research indicates that Apple is gravitating towards replacing cron and some other things with launchd). And do I just make the script in AppleScript? Does it need to be a .sh file?
    – Crowbeak
    Commented Nov 11, 2013 at 1:13
0

Instead of performing a cron job like above, why not simply set up a voice to read notifications aloud? you can do this in the dication and speech setting

1
  • 1
    Please elaborate on how this can be done (not everyone may be aware of the settings you're referring to). Editing your answer to provide this information would also make it substantial, rather than making it look like a comment on another answer.
    – M K
    Commented Feb 12, 2014 at 4:26
0

You can make the computer speak the alerts (including low battery alert) by going into 'System Preferences', clicking on 'Dictation & Speech', choosing the 'Text to Speech" tab, and putting a check mark in front of ‘Announce when alerts are displayed’.

0

There is an app now in the App Store, called BattMan, which I think will do what you need. BattMan lets you choose the battery charge level (as percentage and remaining time, whichever comes first) and will display the notification, but also play a sound (which you can separately enable/disable).

You can download it from the Mac App Store.

Full Disclosure: I am the developer behind it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .