Page 1 of 3

Battery monitor for Dingo Alpha5

Posted: Sun 27 Jan 2008, 21:03
by kirk
I found a small battery monitor that JWM will swallow into the tray. The home page is here:

http://www.tigr.net/afterstep/view.php? ... asapm/data

Compiled it on Dingo alpha5. I modified /root/.jwmrc-tray to swallow the applet and /etc/rc.d/rc.modules2 to detect if we're using a laptop so that we modprobe battery and ac. I've attached a pet package for testing and the source for asapm. I've tested this on a laptop and on a desktop (to make sure nothing happens if we're not using a laptop.)

Note: This pet package will over-write /root/.jwmrc-tray and /etc/rc.d/rc.modules2.

EDIT: Hacked the source to remove the time remaining, which didn't show on the screen. And removed the Battery slider, half of that didn't show. So made it a little smaller too. Reboot after installing.

Posted: Mon 28 Jan 2008, 00:55
by Béèm
Nice idea.
You should have mentioned that a reboot is necessary after installation.

Unfortunately, the tray height isn't enough to display the complete applet.
I have the little battery and the percentage.
When I double the tray height from 28 to 56, I can see most of the time as well.

Maybe that horizontal battery should only be displayed, when the laptop is AC powered. When reducing the fonts, I think percentage and time can be displayed in a normal height tray then.

Posted: Mon 28 Jan 2008, 01:13
by kirk
Sorry, yes a reboot is needed.

Béèm, does yours look different that the shot I've attached? It does cut off the bottom of the display, the part that has time remaining. But If I shrank the display enough to see that, it would be too small and hard to read.

Posted: Mon 28 Jan 2008, 02:14
by Béèm
Yes kirk, it is the same as you have.

Well the percentage is a good indication already.

I am no programmer and so didn't look at the code.

In case the laptop is on battery, there is no need to have that horizontal battery with the power cord.

If that could be suppressed in that case, maybe there is room enough for both percentage and time.

When the laptop is on AC, it can then stay as it is now.

Just a thought.

Posted: Mon 28 Jan 2008, 03:11
by NathanO
Before I try and download this, because of the problems I had with conky in pcPuppyOs, do you look just for BAT0, or do you look for any battery, my HP Pavilion zv6000 reports it's battery as BAT1.

NathanO

Posted: Mon 28 Jan 2008, 04:46
by John Doe
thanks kirk, worked great over here.

tested like you did, tried it on laptop and then moved over to desktop.

no problems either way.

I hope this makes it into the final dingo.

Any thoughts on the modules ac, fan, processor, and thermal. Is it possible to autodetect if they are needed and load those modules? I was checking out lm_sensors but was wondering if anyone knew a way to do it without adding anything.

I also checked out this page:
http://gentoo-wiki.com/HARDWARE_Sensors

it mentions that use of lm_sensors on IBM Thinkpads is not recommended. Not sure if that's outdated or not, so maybe it's not a good idea.

Just thowing out some ideas. Love to help this go even a bit further.

Posted: Mon 28 Jan 2008, 14:07
by kirk
As Béèm had mentioned the time remaining was off the bottom of the screen and the battery slider was half way off the bottom of the screen. So I hacked the source to remove both of them. This also took about 10K off the executable. I edited the original post. If you installed the old package you don't need to remove it, just install the new one.

NathanO,

I don't know. I didn't write this app. Try it out in a new pup_save file.

John Doe,

I haven't looked into that, but I suppose in rc.modules if you detect a battery then you could load any other laptop modules that might be universally needed.

Edit: Just re-read what you wrote, it does load module ac.

Posted: Mon 28 Jan 2008, 16:13
by HairyWill
Kirk,
I am trying to compile this in alpha 4

Code: Select all

./configure
loading cache ./config.cache
configure: error: can not find install-sh or install.sh in autoconf ./autoconf
I am interested in compiling asmix to see if it works as a cheaper volume control but getting the same error.

Any clues.

Posted: Mon 28 Jan 2008, 18:22
by NathanO
Downloaded and tested. Also did a 'time it will run' on the battery. Ran about 1:50. There we no warning about time left, wonder if it could pop up something say at 5% or maybe change color?

I tried to keep the computer somewhat busy. Right now watching the 'recharge' %.

NathanO

Posted: Tue 29 Jan 2008, 01:01
by kirk
HairyWill,

I haven't tried compiling it in alpha4, but should work. Might want to try a new pup_save file and/or check your md5sums for alpha4 and the devx file. I compiled the mixer app in alpha5, no problems.

Posted: Tue 29 Jan 2008, 03:20
by HairyWill
thanks Kirk,
I was actually after asmix but asmixer might fit the bill better. I've just tried compiling on 2.14R and got the same error. I will try on the latest dingo tomorrow. Did you build each app individually?

Posted: Tue 29 Jan 2008, 17:39
by MikeLockmoore
Any idea whether this will will work on pre-Dingo Puppy releases? I still use 2.17 quite a bit on my laptop and don't have a monitor working on it right now. I realize there could be library or module dependencies that might throw things off.
--
Mike Lockmoore

Posted: Tue 29 Jan 2008, 18:24
by HairyWill
It worked for me in 2.14R
As kirk said it over-writes your jwm taskbar and I had to load the kernel modules manually.

Before installing create a backup of /root/.jwmrc-tray, after installation restore the backup tray and edit it to include the following swallow entry

Code: Select all

<Swallow name="asapm">
asapm
</Swallow>
there is a -u or -U argument that can be used to specify the update interval, try
asapm --help after installing
you will need to

Code: Select all

modprobe battery
modprobe ac
before starting it
I'm not sure if the rc.modules2 included will get run on boot in earlier pups so you might need to add those two lines to /etc/rc.d/rc.local

Posted: Tue 29 Jan 2008, 22:25
by Béèm
MikeLockmoore wrote:Any idea whether this will will work on pre-Dingo Puppy releases? I still use 2.17 quite a bit on my laptop and don't have a monitor working on it right now. I realize there could be library or module dependencies that might throw things off.
--
Mike Lockmoore
I installed Kirk's little tool on Dingo. (alpha 5)

Posted: Tue 29 Jan 2008, 23:57
by HairyWill
NathanO
asapm uses a config file ~/.asapmrc
this says it can be used to fire commands on AC on/off and on the battery reaching upper and lower thresholds.
I got the AC on/off to play a sound but the thresholds bit didn't work for me, this might be because my battery is so knackered it didn't stay on the threshold for long enough.

Kirk,
I tried extracting the source tar again and got what I needed, thanks for your help I don't know what went wrong. I'm now playing with asmix.

Posted: Wed 30 Jan 2008, 00:23
by NathanO
Have installed it under 3.01. I do not see a file .asapmrc anywhere, yes I have enabled hidden files. Can not find it with Gtkfind or Pfind. It did change the background color for part of my taskbar to the left of the battery monitor.

NathanO

Posted: Wed 30 Jan 2008, 00:27
by NathanO
One more thing, it made the 'free memory' to thin to read, but hovering over it with cursor show info, so I am not too worried.

NathanO

Posted: Wed 30 Jan 2008, 14:56
by NathanO
Silly question.

On my tower I have an APC Back-UPS XS 1500. It has a USB connection that Win see's. Is there a program to monitor UPS's that will work for Puppy?

Rather then having to have two different programs, could this one have an option to do so? I am willing to be the tester, but 3.01 compatability would be a help as that is what I will stay with until 4.0x is fully released.

Posted: Thu 31 Jan 2008, 15:53
by Rickrandom
It's probably my inability to read instructions, but trying Dingo Alpha 6, which has this built in, I get a sort of dark grey on grey, as the attached.

Do I need to run anything, or check any settings, or find out if my laptop contains any particular power management?

Laptop is an NEC i-select:

Processor Intel(R) Celeron(R) M processor 1.50GHz
Memory 765MB (181MB used)

Frugal install on NTFS disk, booting via GRUB.

Posted: Thu 31 Jan 2008, 17:41
by kirk
Rickrandom,

I don't know if I can help, I didn't write this app, just hacked it down a bit. If you have some time, open a console and type:

# asapm

Another battery monitor should open on your desktop. Copy and paste the terminal output here. (after highlighting something in the rxvt terminal window shift-delete copies to the clip board)

Also, your laptop does actually have the battery installed?