The time now is Sun 22 Apr 2018, 06:49
All times are UTC - 4 |
Page 1 of 3 [34 Posts] |
Goto page: 1, 2, 3 Next |
Author |
Message |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Wed 30 Dec 2009, 23:28 Post subject:
Vattery+IBAM Subject description: Adaptive Laptop Battery Monitor for the Systray - now with additional applets! |
|
I've modified Vattery, a lightweight battery meter for the system tray and modified it to use IBAM as the backend. You can read about IBAM's coolness here: http://ibam.sourceforge.net/
Vattery also will warn you when your battery is getting low so you know you need to save your data. I changed it to use Xdialog instead of xmessage. You can change it to have it run any script you like when the battery gets low.
I've only tested this on 4.3.1 so there's some chance Vattery won't work with other versions or it may have dependencies.
Edit: updated to not need /proc/acpi/battery/BAT0
Edit: 1/19/10 updated to use the charging color for fully charged battery
Edit: 1/20/10 Added trayclock, an analog clock for the systray by the same developer.
Edit 1/26/10 Cosmetic updates to Vattery, and added traytemp for monitoring your Cpu temperature.
Edit:4/29 Apparently I unintentionally removed ibam from the Vattery pet last time I uploaded it, so I've attached the ibam pet here. Sorry about that.
 |
Description |
|

Download |
Filename |
ibam-0.5.2.pet |
Filesize |
19.14 KB |
Downloaded |
1347 Time(s) |
Description |
|

Download |
Filename |
traytemp-0.7.pet |
Filesize |
56.08 KB |
Downloaded |
1493 Time(s) |
Description |
|

Download |
Filename |
vattery-ibam-0.7.pet |
Filesize |
56.73 KB |
Downloaded |
1643 Time(s) |
Description |
|
Filesize |
2.38 KB |
Viewed |
9146 Time(s) |

|
Description |
|

Download |
Filename |
trayclock-0.33.pet |
Filesize |
18.4 KB |
Downloaded |
1165 Time(s) |
Last edited by jemimah on Thu 29 Apr 2010, 09:41; edited 9 times in total
|
Back to top
|
|
 |
Shel
Joined: 11 Apr 2009 Posts: 103 Location: Seattle, WA, USA, or Southern France
|
Posted: Thu 31 Dec 2009, 04:34 Post subject:
|
|
No tickee, no workee, at least on my Toshiba Portege R100:
Code: | flatso:/root # vattery
can not read /root/.config/vattery/config: File is empty
** (vattery:25899): CRITICAL **: file main.vala.c: line 1276: uncaught error: Failed to open file '/proc/acpi/battery/BAT0/state': No such file or directory
** (vattery:25899): CRITICAL **: file main.vala.c: line 1276: uncaught error: Failed to open file '/proc/acpi/battery/BAT0/state': No such file or directory
|
It doesn't create the config file, which I can certainly do if I know the format, and the second error may be resolved with proper configuration, as my machine has two batteries, BAT1 and BAT2.
However the 'state' files for the batteries are empty ...
-Shel
EDIT: Also, it doesn't uninstall cleanly. I installed it by download/save, then clicking on the .pet file. It installed fine: vattery and ibam went into /usr/local/bin, and a startup script into /root/Startup. Uninstalling from the package manager, although it reported no error, did nothing; all the files were still present.
I'll give it another go on the next rev, though, as I really want better power management on this laptop.
-S
Last edited by Shel on Thu 31 Dec 2009, 06:20; edited 1 time in total
|
Back to top
|
|
 |
Dromeno
Joined: 12 Sep 2008 Posts: 543
|
Posted: Thu 31 Dec 2009, 04:44 Post subject:
Not working on AsusEEE 900 |
|
same on AsusEEE 900:
can not read /root/.config/vattery/config: File is empty
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Thu 31 Dec 2009, 09:30 Post subject:
|
|
The config file error is normal for the first run. It will create the config file automatically if you click on the preferences.
It needs acpi battery support in the kernel so it won't work work without a /proc/acpi/battery directory. It probably also assumes you have only one battery.
I will look into the uninstall thing.
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Thu 31 Dec 2009, 09:52 Post subject:
|
|
Ok I rebuit the pet.spec file and just tested and an a fresh 4.3.1 install and the uninstaller worked. The only files this pet installs are /usr/local/bin/vattery /usr/local/bin/ibam and /root/Startup/vattery.
|
Back to top
|
|
 |
Shel
Joined: 11 Apr 2009 Posts: 103 Location: Seattle, WA, USA, or Southern France
|
Posted: Thu 31 Dec 2009, 11:06 Post subject:
|
|
jemimah wrote: | The config file error is normal for the first run. It will create the config file automatically if you click on the preferences. |
Maybe, but it never got far enough for me to have anything on which to click.
Quote: | It needs acpi battery support in the kernel so it won't work work without a /proc/acpi/battery directory. It probably also assumes you have only one battery. |
I'm using the supplied kernel that came with 4.3.1. Your 'acpitool' works, at least as far as checking the battery:
Code: | flatso:/root # acpitool -b
Battery #1 : charged, 100.0%, 00:00:00
Battery #2 : charging, 54.19%, 03:10:36
|
How can I check for the acpi stuff in the kernel?
If it only checks one battery, but I can tell it which one, that would be OK.
The /proc/acpi/battery directory exists, as do the state files for BAT1 and BAT2. The files are zero-length, however:
Code: |
flatso:/root # ls -la /proc/acpi/battery
total 0
dr-xr-xr-x 4 root root 0 2009-12-31 16:02 .
dr-xr-xr-x 12 root root 0 2009-12-31 15:17 ..
dr-xr-xr-x 2 root root 0 2009-12-31 16:02 BAT1
dr-xr-xr-x 2 root root 0 2009-12-31 16:02 BAT2
flatso:/root # ls -la /proc/acpi/battery/BAT1
total 0
dr-xr-xr-x 2 root root 0 2009-12-31 16:02 .
dr-xr-xr-x 4 root root 0 2009-12-31 16:02 ..
-rw-r--r-- 1 root root 0 2009-12-31 16:02 alarm
-r--r--r-- 1 root root 0 2009-12-31 16:02 info
-r--r--r-- 1 root root 0 2009-12-31 16:02 state
flatso:/root # ls -la /proc/acpi/battery/BAT2
total 0
dr-xr-xr-x 2 root root 0 2009-12-31 16:02 .
dr-xr-xr-x 4 root root 0 2009-12-31 16:02 ..
-rw-r--r-- 1 root root 0 2009-12-31 16:02 alarm
-r--r--r-- 1 root root 0 2009-12-31 16:02 info
-r--r--r-- 1 root root 0 2009-12-31 16:02 state
|
Thanks.
-Shel
PS: As a quick battery check, this one-line script, attached to a desktop icon, isn't all bad:
Code: |
gxmessage -title "Battery Status" "`acpitool -b`"
|
-S
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Thu 31 Dec 2009, 11:10 Post subject:
|
|
Shel, does IBAM work from the command line? I was thinking of changing Vattery to use IBAM get the percent instead of directly reading the BAT0 file. I just have to figure out how to use the regular expression stuff in Vala.
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Thu 31 Dec 2009, 14:47 Post subject:
|
|
Ok I've modifed it to use IBAM exclusively to get it's data. This is not thoroughly tested, so let me know how it goes.
|
Back to top
|
|
 |
trapster

Joined: 28 Nov 2005 Posts: 2106 Location: Maine, USA
|
Posted: Thu 31 Dec 2009, 15:56 Post subject:
|
|
acpitool is working well on my eeepc 1005HA using wmii wm.
I symlinked acpitool to acpi and use this for the task bar in wmiirc:
Code: | #Modified by trapster Status Bar Info
status() {
echo -n ' WiFi:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) '|' $(acpi -b | sed 's/.*, \{0,2\}\([0-9]\{1,3\}%\),.*/BAT0: \1 | /') '|' $(uptime |
sed 's/.*://; s/,//g') '|' $(date +%I:%m) |
_________________ trapster
Maine, USA
Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
|
Back to top
|
|
 |
Shel
Joined: 11 Apr 2009 Posts: 103 Location: Seattle, WA, USA, or Southern France
|
Posted: Fri 01 Jan 2010, 06:55 Post subject:
|
|
Shel wrote: |
ibam works, vattery works, and it seems to reflect the total of both batteries.on my Toshiba Portege R100.
Since this machine fully charges the internal battery before charging the external one, but discharges them more or less at the same time, it'll take me a little while to know how accurate it is. |
Kinda-sorta.
At the moment, the vattery icon is showing fully charged, and the mouse-over hovertext reflects that.
ibam reports ...
Code: |
flatso:/root # ibam -a
Bios percentage: 100 %
Battery percentage: 100 %
Soft low percentage limit: 5 %
Charge percentage: 100 %
Bios time left: 4:17:51
Battery time left: 5:03:29
Adapted battery time left: 5:03:29
Charge time left: 0:00:00
Adapted charge time left: 0:00:00
Total battery time: 5:03:29
Adapted total battery time: 5:03:29
Total charge time: 8:53:33
Adapted total charge time: 8:53:33
Profile logging enabled.
Current file: /root/.ibam/profile-002-full
|
However, the real scoop is ...
Code: |
flatso:/root # acpitool -b
Battery #1 : charged, 100.0%, 00:00:00
Battery #2 : charging, 73.65%, 01:57:09
|
... so, at least as far as the on-charge accuracy, vattery+ibam is just showing the main battery.
However, if I snatch the AC cord out, vattery's icon+mouseover quickly drops to 83%, which is a reasonable balance between the power stored in the internal battery and the twice-as-large external one.
It looks pretty good to me so far.
-Shel
|
Back to top
|
|
 |
Shel
Joined: 11 Apr 2009 Posts: 103 Location: Seattle, WA, USA, or Southern France
|
Posted: Wed 06 Jan 2010, 01:55 Post subject:
|
|
Just a small further progress report ...
This worksgreat. It reports what the BIOS thinks is the battery life remaining, and that basically reflects the real state of things. It's a little conservative, in that there's a bit more power available than it reports, but I'd rather have a gas gauge that reads low than be standing on the side of the road holding a gas can and waving down a ride.
This with a two-battery Toshiba Portege R100.
Now for the big problem ... why does the battery run down when the machine is nominally "off?"
-Shel
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Wed 06 Jan 2010, 02:19 Post subject:
|
|
That I don't know, hardware design flaw maybe? Perhaps you'll have to remove the battery when it's off.
|
Back to top
|
|
 |
OverDrive
Joined: 02 Jan 2006 Posts: 171 Location: Cleveland, OHIO,USA
|
Posted: Mon 18 Jan 2010, 09:12 Post subject:
|
|
This could very well be an improvement over asapm. How do I get the icon to show the blue color when it is charging?
OverDrive
_________________ Instant Puppy Fan!!!
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Mon 18 Jan 2010, 11:41 Post subject:
|
|
It's supposed to do that automatically. If it's not can you post the output of 'ibam --percentbattery' both when it's charging and when it's discharging. This is a bug a few people have mentioned but I'm having trouble tracking it down.
|
Back to top
|
|
 |
OverDrive
Joined: 02 Jan 2006 Posts: 171 Location: Cleveland, OHIO,USA
|
Posted: Mon 18 Jan 2010, 21:48 Post subject:
|
|
My bad, I didn't realize that icon is red when the notebook is plugged in and the battery is topped off. Not what I was expecting. I figured as long as it was plugged in it would be in "charging mode". When the battery is discharged some amount and you plug it in, the icon *does* turn blue and then when it tops off it goes back to red even though it is still plugged in. So, like I said, it does change colors, just not in the way I was expecting.
Best Regards
OverDrive
_________________ Instant Puppy Fan!!!
|
Back to top
|
|
 |
|
Page 1 of 3 [34 Posts] |
Goto page: 1, 2, 3 Next |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|