Low Battery Warning Using conky

I prefer getting rid of the panel and using the desktop to show peripheral information. As you guessed, conky is the best tool to do that. However, one of the things I did miss was low battery warnings. But it turned out to be a lot simpler. Here is the conky config for battery:

        BATTERY: ${color}${battery BAT0}
        ${if_match ${battery_percent BAT0} <= 10}
        ${if_match "${acpiacadapter}" == "off-line"}
        ${exec zenity --warning --text "Low Battery"}

Put the above code in one line, I have broken it here for readability.

This uses one more lightweight but extremely useful application - zenity. Conky helps us detect low battery, but you can choose to use other things, like a bash script or another application, to prompt for warnings and handle it the way you want.

Say your thought!

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.



Abhijit Nadgouda
iface Consulting
+91 9819820312
My bookmarks


This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.