Battery Monitoring Dotpup for JWM

Stuff that has yet to be sorted into a category.
Message
Author
setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#81 Post by setecio »

Excellent. I saved a backup copy of existing batmon.sh as batmon.old, and replaced everything after the comments with your new code in the batmon.sh, and the battery level on the green batmon icon in the taskbar is now displaying a perfect % remaining figure.

Thanks for that. :D

When I hover the mouse over it, a little box appears with 'aasdf' in it. Can this be changed or stopped ?

brad_chuck
Posts: 286
Joined: Tue 16 Aug 2005, 03:47
Location: Appalachian Mountains

#82 Post by brad_chuck »

Great work HairyWill and setecio.

Next time I get to it I will make this an option in the batmonsetup.sh program and then folks with APM can use batmon without all this hassle.

I tried sed last night and gave up. Perhaps I should learn awk.....

Anyway thanks for the code.

User avatar
gdemonta
Posts: 190
Joined: Mon 19 Feb 2007, 08:17
Location: Paris, France

#83 Post by gdemonta »

Hello Brad_chuck,
I tried batmon a few days ago and I got the famous %- problem. Yesterday I noticed the line I had previously added to automatically mount one of my partition didn't function either since that day (I know I'm a bit slow...).
I went to the rc.local file and, wow, I found the batmon line your script added fot modprobing battery had benn added in the same line as my automount! So i just pulsed "enter" to separate both lines and I got the batmon working and my automount working again. It works great!
I also wanted to point out for the icewm users to edit preference in root/.icewm ant activate taskbarAPM something in order to show the batmon.
[color=blue]Dumbledore: "The evidence of the Dark Lord's return is incontrovertible"[/color]
IBM X31 - Puppy 2.16 Hard disk install with EZpup

Kezo
Posts: 4
Joined: Thu 24 Jan 2008, 19:09
Location: Hungary

#84 Post by Kezo »

Dear all,

I just started to use Puppy3.01 on a FujitsuSiemens K7610W laptop. I made batmon visible on the tray and it shows the good percentage of the battery but if I move the mouse above the tray it shows the "aasdf" which is weird to me...
I would appreciate if anyone had a good idea what to do!

BTW, this is the first Linux what I brave enough to try, but I really like it!

MichelC
Posts: 1
Joined: Tue 26 Feb 2008, 13:16

Batmon does not work with 2 batteries

#85 Post by MichelC »

I run Puppy Linux 3.01 on a Compaq Armada laptop. Batmon used to work perfectly until I add a second battery. I then got -% in the tray.
Running batmon.sh in a terminal window gives the error :
--------------
/usr/local/bin/batmon.sh: line 18: let: per=((2885
2655*100)/(2885
2655)): missing `)' (error token is "2655*100)/(2885
2655))")
---------------
I look at the script and the tmp files and made the following changes to the script to add the values of the two batteries :
--------------
for a in `ls`
do
rc1="`cat /proc/acpi/battery/$a/state | grep "remaining capacity:" | sed -n 's/remaining capacity: //p' | sed -n 's/ m[A-Z]h//p'`"
cap1="`cat /proc/acpi/battery/$a/info | grep "last full cap" | sed -n 's/last full capacity: //p' | sed -n 's/ m[A-Z]h//p'`"
rc="($rc+$rc1)"
cap="($cap+$cap1)"
done
echo $rc >> /tmp/batmon.rc
echo $cap >> /tmp/batmon.cap
----------------
I now get what seems to be ok. I am not a Linux programmer and would like to know if my changes are valid and is there a better way to do it.

Thanks

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

hexedit

#86 Post by raffy »

setecio wrote:When I hover the mouse over it, a little box appears with 'aasdf' in it. Can this be changed or stopped ?
You can use hexedit to find and change it.

whatshisname
Posts: 22
Joined: Mon 12 May 2008, 00:34

#87 Post by whatshisname »

Been trying for a couple of days to get some kind of battery monitoring working with my ancient Dell Inspiron 2600 laptop. Running 4.3.1 Puppy. Previous versions of Puppy worked. Oddly, though, I've tried loading some livecd's of older versions of Puppy and they all present the contents of "/proc/apm" as indicated below.

Have to boot with "acpi=off".

No matter whether the laptop is plugged in or not, "cat /proc/apm" yields:

# more /proc/apm
1.16ac 1.2 0x03 0x01 0xff 0x80 -1% -1 ?

Unless I can get something besides the above, no battery watching script is going to work.

I've tried "modprobe apm" to make sure the module is loaded. Still no joy.

Suggestions anyone?

Thanks.

Post Reply