Skip to main content

Apple MacBook macOS Critical Battery Warning at 5% or less

Coming from Windows where there's an entire set of configuration options to set Low Battery Warnings, Critical Battery Warnings and Actions, etc. I'm dismayed that macOS doesn't have any configuration at all, and only has a permanently fixed Low Battery notification at 10% and nothing else.

I have made a script (available on GitHub Gist) that will show a warning alert like this: 

You can save the first file as /usr/local/bin/battcritical (without the .sh) and if you only want it in current session, just run it with:

nohup /usr/local/bin/battcritical &

To have it start warning you at another percentage (and below), change the number after -le on line 11 to your desired percentage.

In order to have it automatically run every time you boot up your Mac, also save the second file as /usr/local/bin/login-scripts (without the .sh), then drag and drop the login-scripts file into the Login Items list in your System Settings.

Remember to give both files the execute permission: 

sudo chmod a+x /usr/local/bin/battcritical
sudo chmod a+x /usr/local/bin/login-scripts

Scripts embedded below for reference:

~-~

Comments

Popular posts from this blog

Can't exit Toddler Lock on Android phone

Toddler Lock will lock your Android phone completely so you can give it to a baby or toddler to play with. The only danger from the kid is that it may throw your phone and break it. But other than that, the kid will not be able to damage the phone by unlocking it and messing with what's inside. Here's the problem. The security of Toddler Lock is so tight that it would seem the only way to exit out of the app is to tap four corners of screen in a clockwise direction. (Note that you have to tap the four corners one after the other. Tap any corner, remove your finger, tag next corner in CW direction, remove your finger, and so on. Some people seem to think you need to hold all corners simultaneously which is wrong.) You may think a restart may also unlock it but even pulling out the battery for minutes (or perhaps hours) will not help. You will be stuck in Toddler Lock no matter what. This is fine until my screen started having problems. Two of the four corners I had to touch...

Make Samsung DVD-C350 region-free

Update 2: An anonymous commentator has shown me a way to make Region 1 players (such as DVD-H1080R) region-free by first converting it to Region 3, then applying my region-free hack below. For details, click here or look for a comment by an Anonymous user dated 18 April 2011. Update: The instructions in the original post below did not make the DVD player region-free. Instead it only locked it to region 1. Many thanks to Anonymous who posted the first comment on this post, I now have alternate instructions. Note: If you have edited the numbers menu (see original post) , I suggest you return it to the original settings you had backed up. A modified numbers menu may prevent the instructions below from working properly.

Group, Ungroup and Regroup disabled in Word

I was editing a Microsoft Word document which had a collection of shapes and text boxes grouped together. I wanted to modify some of the shapes, and therefore I had to ungroup them. But when I right-click the group and open the Group menu, all three options namely Group, Ungroup and Regroup are completely disabled or grayed out. I couldn’t figure out what’s wrong. This group of objects is perfectly ungroupable, and I can even select objects within the group. However, Microsoft Word 2007 is not letting me ungroup it. I searched the Internet for a solution, but did not find anything very useful. The closest I came across is this statement: “The type of Text Wrapping doesn't make any difference as long as it isn't In Line with Text.” ( Link here ) Anyway, I changed the text wrapping of the group of objects from ‘In line with Text’ to ‘Tight’ and viola! I could now ungroup it and edit it. The document got a bit messed up when I did so, but after I ungrouped, edited and regro...