xosd-battery: a minimalistic battery monitor for X11
WARNING: This project is no longer maintained. See
xstatbar for a maintained
xosd-battery is a simple, text-only battery monitor for X11 that uses
the XOSD library to render
the current percentage of battery power remaining, and current power source
(battery or AC), to the X11 root window. All information is queried
The sysctl-names for the current and maximum charge, and the
sysctl for the power indicator (if using AC or Battery for power)
must be specified on the command line. These sysctl's are identical
to what one would type on the command line when using
Additional sysctl's can be specified for warning and
low capacity measurements.
Additionally, you can specify how often to update the display, the color/font
used, the position (x/y offsets and alignment), shadowing, and outline.
Click here to see a simple screenshot (warning: the file is big... scaling it
down distorts the battery display).
Note that the clock is in the lower-right corner of the screen, in green.
That battery display is generated by the following command in my
/usr/local/bin/xosd-battery -x -1 -y -1 -z 30 -b black \
-n hw.sensors.acpibat0.watthour3 \
-m hw.sensors.acpibat0.watthour0 \
-i hw.sensors.acpiac0.indicator0 \
-w hw.sensors.acpibat0.watthour1 \
-l hw.sensors.acpibat0.watthour2 &
In this screenshot, you'll notice my
program in the top-left of the screen and my
program in the upper-right corner.
First, make sure you have the XOSD library installed on your system.
Most operating systems have easily installable package for this.
Then download the file below and simply
- tar xvzf xosd-battery.tar.gz
- cd xosd-battery
- make install
Type make uninstall, or simply remove the program and man-page,
which are by default installed as
See the man page here: xosd-battery(1).
Copyright (c) 2008 Ryan Flannery <firstname.lastname@example.org>