Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This happens to me more than I'd like to admit, but sometimes I don't notice the power getting low since it only shows up in my status bar, then the computer just quits. I'd like a big alert that warns me before this happens. Is there any way for it to alert me? Ubuntu has a nice popup that tells you it's getting low.

share|improve this question
    
Configure the power-manager from your desktop environment to do "something" - this can usually range from "nothing", over "run a command", to "hibernate"/"power off". –  peterph Jan 9 '13 at 19:33
    
Which desktop environment? –  Renan Jan 10 '13 at 0:17
    
@peterph I only have the "Power off" and "Hibernate" options. –  Travis R Jan 10 '13 at 2:22
    
@Renan running Cinnamon. –  Travis R Jan 10 '13 at 2:23
    
@TravisR sorry, I meant to say configure the behaviour when critical battery level is reached –  peterph Jan 10 '13 at 8:33
add comment

3 Answers

write a script!

battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'`
if [ $battery_level -le 10 ]
then
    notify-send "Battery low" "Battery level is ${battery_level}%!"
fi

then cron it to run every few minutes or so. But yeah, if you can do it through the GUI, that's probably a much better way of doing it.

share|improve this answer
add comment

I had that same problem and I figured out a workaround. I installed from Linux Mint repositories an app called GKrellM. It monitors lots of stuff on your machine and there is battery. Setup with alarms, it works for me like a charm.

more info at:

http://www.gkrellm.net/

share|improve this answer
add comment

As I don't have Gnome Shell or Cinnamon installed, I cannot be of direct help as accessing the source could would be much practical since it's rather easy adding such a rudimentary extension with JavaScript.

You should open :

/usr/share/cinnamon/js/ui/status/power.js

and search for percentageText - subsequently, you ought to be able to add a pop-up message or alert.

share|improve this answer
    
Interesting, didn't know this stuff is in javascript. But no /status directory and no power.js I can find anywhere in the /cinnamon/js directories. –  Travis R Jan 12 '13 at 18:09
    
Have you tried to search for it from root using : find / -type f -name power.js –  nesyphlopanuri Jan 13 '13 at 14:32
    
Ran that, nothing found. –  Travis R Jan 14 '13 at 22:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.