dtpower Code
dtpower is useful for monitoring the battery-state of unix laptops.
Brought to you by:
juergen-m
README dtpower is useful for monitoring the battery-state of laptops. dtpower is designed to be used as an app in CDE's frontpanel. dtpower calls "acpi -a" to get the state (power plugged in or not) of the power adapter. The icon changes according to the state. Then "acpi -b" is called to set a tooltip with the current load of the battery. 1. PREREQUISITES ----------------------------- Motif 2.3+ On some GNU/Linux distributions appropriate 'dev' packages need to be installed separately - e.g. xorg-dev, motif-dev, etc. 2. BUILDING AND INSTALLING ----------------------------- To build and install using default configuration options run './configure' , run 'make', then 'make install' as root. Default bindir is /usr/dt/bin for dtpower and /usr/dt/app-config/icons/C for the xpm-files. You can also install the binary somewhere in your PATH and the xpm-files in $HOME/.dt/icons if you do not have root-privileges. Configure your panel to show the app: copy power.fp to the directory $HOME/.dt/types It has the followring format: ----------- snip ----------------- CONTROL Power { TYPE client CONTAINER_NAME Top CONTAINER_TYPE BOX POSITION_HINTS 14 CLIENT_NAME dtpower CLIENT_GEOMETRY 60x60 LABEL Power } ----------- snip ----------------- where the POSITION_HINTS defines the position in your panel. If you decided to use Dtwm*primaryColorSetId: 8 instead of the default bg color (ID 5) of dtwm you can use the 8th line of you colorpalette, i.e. dtpower -bg `head -n 8 /home/jma/.dt/palettes/Crimson.dp | tail -1` Since version 1.5 the line above should not be necessay any longer as i try to catch the color. Additionally you can use dtpower in symbolsize. I took away the windowdecorations in order to use it as desklet, you can still move it around with SHIFT-ESC from your windowmanager. 3. COPYING ----------------------------- This software is distributed under the terms of the MIT license. You may use, modify and redistribute the software under the terms of this license. See the included LICENSE file for details.