Difference between revisions of "KThinkBat"

From ThinkWiki
Jump to: navigation, search
(new version with tp_smapi support)
 
(37 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
==Description==
 
==Description==
  
[https://lepetitfou.dyndns.org/KThinkBat KThinkBat] is a laptop battery monitor for the KDE-Kicker. It is inspired by the Windows Application "Battery Maximizer" which is included with ThinkPads.  
+
[http://lepetitfou.dyndns.org/KThinkBat KThinkBat] is a laptop battery monitor for the KDE-Kicker. It is inspired by the Windows Application "Battery Maximizer" which is included with ThinkPads.  
  
On ThinkPads it uses the SMAPI BIOS through the tp_smapi driver.
+
It can use the SMAPI BIOS (through the [[tp_smapi]] driver) or [[How to make ACPI work|ACPI]] to collect the data. It shows you the current power consumption of the laptop and brings support for a second battery. It is fully customizable including sizes, color, fonts and battery number
  
Homepage: https://lepetitfou.dyndns.org/KThinkBat
+
Homepage: http://lepetitfou.dyndns.org/KThinkBat
  
Author: Tobias Roeser
+
Author: [http://lepetitfou.dyndns.org Tobias Roeser]
  
Latest Version: 0.1.5_alpha2
+
Latest Version (2007-07-29): 0.2.8
  
 
==Screenshot==
 
==Screenshot==
Line 15: Line 15:
 
[[Image:KThinkBat.png]]
 
[[Image:KThinkBat.png]]
  
Offline Mode: You see how much power left and how much is consumed at the moment.
+
Offline Mode: you see how much charge is left and the current discharging rate.
  
[[Image:KThinkBat_ac.png]]
+
[[Image:KThinkBat_dual.png]]
  
Online Mode: You see the loading-power.
+
Online Mode: you see how much charge is left and the current charging rate. This screenshot is taken with the disabled "summarize batteries" option.
  
 
==Installation==
 
==Installation==
Line 28: Line 28:
 
  make
 
  make
 
  su -c 'make install'
 
  su -c 'make install'
 +
 +
Alternatively, to minimize filesystem clutter you can install KThinkBat into {{path|/opt/kthinkbat}} and add just a few symlinks under {{path|/usr}}:
 +
 +
mkdir -p /opt/kthinkbat
 +
./configure --prefix=/opt/kthinkbat
 +
make
 +
make install
 +
cd /usr/lib/kde3
 +
ln -vfs ../../../opt/kthinkbat/lib/* ./
 +
cd /usr/share/apps/kicker/applets
 +
ln -vfs ../../../../../opt/kthinkbat/share/apps/kicker/applets/kthinkbat.desktop ./
 +
 +
(The above paths are for {{Fedora}} 4 and 5, and may need to be adjusted for other distributions.)
 +
 +
If you already have the applet running, run {{cmduser|killall kicker; kicker}} to restart it.
  
 
==Gentoo==
 
==Gentoo==
You can use the the ebuild from this [https://lepetitfou.dyndns.org/svn/portage-overlay-lefou/trunk/ portage overlay], category/package: [https://lepetitfou.dyndns.org/svn/portage-overlay-lefou/trunk/app-laptop app-laptop]/[https://lepetitfou.dyndns.org/svn/portage-overlay-lefou/trunk/app-laptop/kthinkbat kthinkbat].
+
KThinkBat is available through the Gentoo tree as app-laptop/kthinkbat. Use your favorite package manager to install it.
  
==Patches==
+
emerge -av kthinkbat
  
Here's a small patch that changes the color of the current power consumtion text to white ( for dark background). Furthermore it changes the battery gauge's size (looks nicer if you place the kicker vertical).
+
If you want to use the info provided by the [[tp_smapi]] module, enable the ''smapi'' USE flag.
  
<pre>
+
==openSuSE==
diff -ur kthinkbat.orig/src/kthinkbat.cpp kthinkbat/src/kthinkbat.cpp
 
--- kthinkbat.orig/src/kthinkbat.cpp    2005-12-15 22:54:28.000000000 +0100
 
+++ kthinkbat/src/kthinkbat.cpp 2005-12-15 23:32:10.000000000 +0100
 
@@ -101,7 +101,7 @@
 
void KThinkBat::paintEvent(QPaintEvent* event)
 
{
 
    // Werte fr Gauge und Rand
 
-    QSize gaugeFill(40, 18);
 
+    QSize gaugeFill(40, 14);
 
    QSize gHalfDot(4, 4);
 
    QSize offset(4, 4);
 
  
@@ -135,9 +135,10 @@
+
KThinkBat is included into the community builds (see KDE/Community/openSUSE_Factory, [[ftp://ftp5.gwdg.de/%2fpub/linux/suse/opensuse/repositories/KDE%3A/Community/openSUSE_Factory/x86_64/ here]] for example), though the version is quite outdated atm - 0.2.2.
    painter.drawPolyline(border);
+
You can find newer versions on [http://linux01.gwdg.de/~pbleser/index.php Guru's RPM Site], see [http://linux01.gwdg.de/~pbleser/rpm-navigation.php?cat=System/kthinkbat/ RPMs for KThinkBat] compiled for all SuSE versions back to 9.3.
  
    // Prozent-Anzeige
+
==Debian==
-    painter.drawText( offset.width() + 12, offset.height() + gaugeFill.height() - 5, QString().number(batValue));
 
+    painter.drawText( offset.width() + 14, offset.height() + gaugeFill.height() - 2, QString().number(batValue));
 
  
    // aktueller Verbrauch in W
+
deb http://debian.cp69.de/ unstable main non-free contrib
+    painter.setPen ( "white" );
+
deb-src http://debian.cp69.de/ unstable main non-free contrib
    painter.drawText( offset.width(), offset.height() + gaugeFill.height() + 12, QString().number((mWH + 500)/1000) + " " + unity );
+
     
 +
deb http://debian.cp69.de/ testing main non-free contrib
 +
deb-src http://debian.cp69.de/ testing main non-free contrib
  
    painter.end();
+
To get the repository key, do a:
</pre>
 
  
 +
wget http://debian.cp69.de/repo.asc -O - | sudo apt-key add -
  
 
==Download==
 
==Download==
  
* [http://lepetitfou.dyndns.org/download/kthinkbat/ Download directory]
+
* [http://lepetitfou.dyndns.org/KThinkBat#Download Download from the KThinkBat Site]
* [https://lepetitfou.dyndns.org/svn/portage-overlay-lefou/trunk/app-laptop/kthinkbat/ KThinkPad ebuilds]
+
 
 +
 
 +
 
 +
==See Also==
 +
 
 +
* [[How to use UltraBay batteries]]
  
 
[[Category:Tools]] [[Category:Gentoo]]
 
[[Category:Tools]] [[Category:Gentoo]]

Latest revision as of 01:59, 25 June 2008

Description

KThinkBat is a laptop battery monitor for the KDE-Kicker. It is inspired by the Windows Application "Battery Maximizer" which is included with ThinkPads.

It can use the SMAPI BIOS (through the tp_smapi driver) or ACPI to collect the data. It shows you the current power consumption of the laptop and brings support for a second battery. It is fully customizable including sizes, color, fonts and battery number

Homepage: http://lepetitfou.dyndns.org/KThinkBat

Author: Tobias Roeser

Latest Version (2007-07-29): 0.2.8

Screenshot

KThinkBat.png

Offline Mode: you see how much charge is left and the current discharging rate.

KThinkBat dual.png

Online Mode: you see how much charge is left and the current charging rate. This screenshot is taken with the disabled "summarize batteries" option.

Installation

KThinkBat uses the autotools. For a standard installation use

./configure
make
su -c 'make install'

Alternatively, to minimize filesystem clutter you can install KThinkBat into /opt/kthinkbat and add just a few symlinks under /usr:

mkdir -p /opt/kthinkbat
./configure --prefix=/opt/kthinkbat
make
make install
cd /usr/lib/kde3
ln -vfs ../../../opt/kthinkbat/lib/* ./
cd /usr/share/apps/kicker/applets
ln -vfs ../../../../../opt/kthinkbat/share/apps/kicker/applets/kthinkbat.desktop ./

(The above paths are for Fedora 4 and 5, and may need to be adjusted for other distributions.)

If you already have the applet running, run $ killall kicker; kicker to restart it.

Gentoo

KThinkBat is available through the Gentoo tree as app-laptop/kthinkbat. Use your favorite package manager to install it.

emerge -av kthinkbat

If you want to use the info provided by the tp_smapi module, enable the smapi USE flag.

openSuSE

KThinkBat is included into the community builds (see KDE/Community/openSUSE_Factory, [here] for example), though the version is quite outdated atm - 0.2.2. You can find newer versions on Guru's RPM Site, see RPMs for KThinkBat compiled for all SuSE versions back to 9.3.

Debian

deb http://debian.cp69.de/ unstable main non-free contrib
deb-src http://debian.cp69.de/ unstable main non-free contrib
     
deb http://debian.cp69.de/ testing main non-free contrib
deb-src http://debian.cp69.de/ testing main non-free contrib

To get the repository key, do a:

wget http://debian.cp69.de/repo.asc -O - | sudo apt-key add - 

Download


See Also