Battery Monitoring Dotpup for JWM
Certainly, I'll watch the post for a few days, so post if you want any more info / terminal results / details ...... (just give me beginner instructions.) I wasn't sure whether conky worked or not - I just couldn't see anything referring to 'battery' anywhere ? If it was hidden somewhere? One reading on conky, MPD, said MPD not responding, I'm not sure what that means ?
sh-3.00# apm
sh: apm: command not found
sh-3.00# ls /proc/apm
/proc/apm
sh-3.00#
How can I easily confirm if the laptop uses ACPI or APM ?
sh-3.00# apm
sh: apm: command not found
sh-3.00# ls /proc/apm
/proc/apm
sh-3.00#
How can I easily confirm if the laptop uses ACPI or APM ?
As you have a file /proc/apm I think you can assume apm support. My laptop does acpi and has a directory in /proc called acpi with a whole load of files inside containing system info.setecio wrote:One reading on conky, MPD, said MPD not responding, I'm not sure what that means ?[/qote]I think that stands for Music Player Daemon
http://www.musicpd.org/
this isn't included in vanilla puppy and I don't think I've ever seen a dotpup / pet for itsorry I think I meantsh-3.00# ls /proc/apm
/proc/apmCode: Select all
cat /proc/apm
How can I easily confirm if the laptop uses ACPI or APM ?
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
thanks for that
After I posted last a light bulb came on in my head.
Just because I have acpi it doesn't mean I have to use it.
I changed my kernel boot parameters to include
acpi=off apm=on
and bingo I'm now using apm. For test purposes only as acpi is much more powerful.
so on battery I getand on charge I getFor the record I didn't need to modprobe apm the module was loaded automatically.
After I posted last a light bulb came on in my head.
Just because I have acpi it doesn't mean I have to use it.
I changed my kernel boot parameters to include
acpi=off apm=on
and bingo I'm now using apm. For test purposes only as acpi is much more powerful.
so on battery I get
Code: Select all
sh-3.00# cat /proc/apm
1.16ac 1.2 0x03 0x00 0x00 0x01 55% 29 min
Code: Select all
sh-3.00# cat /proc/apm
1.16ac 1.2 0x03 0x01 0x03 0x09 52% -1 ?
Last edited by HairyWill on Fri 13 Apr 2007, 01:32, edited 1 time in total.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
To make batmon work for apm try replacing the contents of /root/my-applications/bin/batmon.sh with the following. Leaving Brads copyright intact of course.To make a batmon that supports apm and acpi just requires a test for /proc/apm or /proc/acpi before deciding which code to use.
Code: Select all
per=`awk '{print $7}' /proc/apm | awk -F % '{print $1}'`
if [ $per -lt "6" ]; then
if [ "`cat /tmp/batmon.warn.txt | grep warned`" == "" ]; then
Xdialog --msgbox "WARNING! Your battery is low." 0 0 &
echo "warned" >> /tmp/batmon.warn.txt
fi
fi
if [ $per -gt "5" ]; then
rm /tmp/batmon.warn.txt 2> /dev/null
fi
if [ `awk '{print $8}' /proc/apm` -gt 0 ]
then
acon="-"
else
acon="+"
fi
echo -n "${acon}${per}%"
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
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.
When I hover the mouse over it, a little box appears with 'aasdf' in it. Can this be changed or stopped ?
Thanks for that.
When I hover the mouse over it, a little box appears with 'aasdf' in it. Can this be changed or stopped ?
-
- Posts: 286
- Joined: Tue 16 Aug 2005, 03:47
- Location: Appalachian Mountains
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.
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
IBM X31 - Puppy 2.16 Hard disk install with EZpup
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!
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!
Batmon does not work with 2 batteries
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
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
-
- Posts: 22
- Joined: Mon 12 May 2008, 00:34
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.
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.