Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 28 Nov 2014, 22:35
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Vattery+IBAM
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [34 Posts]   Goto page: 1, 2, 3 Next
Author Message
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: 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.
ibam-0.5.2.pet
Description 
pet

 Download 
Filename  ibam-0.5.2.pet 
Filesize  19.14 KB 
Downloaded  1002 Time(s) 
traytemp-0.7.pet
Description 
pet

 Download 
Filename  traytemp-0.7.pet 
Filesize  56.08 KB 
Downloaded  1150 Time(s) 
vattery-ibam-0.7.pet
Description 
pet

 Download 
Filename  vattery-ibam-0.7.pet 
Filesize  56.73 KB 
Downloaded  1231 Time(s) 
systrayApplets.jpg
 Description   
 Filesize   2.38 KB
 Viewed   5883 Time(s)

systrayApplets.jpg

trayclock-0.33.pet
Description 
pet

 Download 
Filename  trayclock-0.33.pet 
Filesize  18.4 KB 
Downloaded  903 Time(s) 

Last edited by jemimah on Thu 29 Apr 2010, 09:41; edited 9 times in total
Back to top
View user's profile Send private message Visit poster's website 
Shel

Joined: 11 Apr 2009
Posts: 103
Location: Seattle, WA, USA, or Southern France

PostPosted: 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
View user's profile Send private message 
Dromeno

Joined: 12 Sep 2008
Posts: 538

PostPosted: 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
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: 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
View user's profile Send private message Visit poster's website 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: 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
View user's profile Send private message Visit poster's website 
Shel

Joined: 11 Apr 2009
Posts: 103
Location: Seattle, WA, USA, or Southern France

PostPosted: 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
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: 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
View user's profile Send private message Visit poster's website 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: 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
View user's profile Send private message Visit poster's website 
trapster


Joined: 28 Nov 2005
Posts: 2029
Location: Maine, USA

PostPosted: 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: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send private message Visit poster's website 
Shel

Joined: 11 Apr 2009
Posts: 103
Location: Seattle, WA, USA, or Southern France

PostPosted: 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
View user's profile Send private message 
Shel

Joined: 11 Apr 2009
Posts: 103
Location: Seattle, WA, USA, or Southern France

PostPosted: 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
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: 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
View user's profile Send private message Visit poster's website 
OverDrive

Joined: 02 Jan 2006
Posts: 165
Location: Cleveland, OHIO,USA

PostPosted: 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
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: 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
View user's profile Send private message Visit poster's website 
OverDrive

Joined: 02 Jan 2006
Posts: 165
Location: Cleveland, OHIO,USA

PostPosted: 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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [34 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

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
[ Time: 0.0936s ][ Queries: 13 (0.0070s) ][ GZIP on ]