Battery monitor for Dingo Alpha5

Stuff that has yet to be sorted into a category.
Message
Author
kirk
Posts: 1553
Joined: Fri 11 Nov 2005, 19:04
Location: florida

Battery monitor for Dingo Alpha5

#1 Post 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.
Attachments
shot2.png
Hacked version
(4.23 KiB) Downloaded 5420 times
Dingo-battery.pet
Pet package
(14.63 KiB) Downloaded 2551 times
asapm-3.1.1.tar.gz
Hacked source. Not needed for testing.
(62.53 KiB) Downloaded 1756 times
Last edited by kirk on Mon 28 Jan 2008, 14:07, edited 2 times in total.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#2 Post 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.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

kirk
Posts: 1553
Joined: Fri 11 Nov 2005, 19:04
Location: florida

#3 Post 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.
Attachments
shot1.png
Old version with half of battery slider showing and time remaining off the bottom of the screen.
(4.07 KiB) Downloaded 5085 times
Last edited by kirk on Mon 28 Jan 2008, 14:09, edited 1 time in total.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#4 Post 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.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

NathanO
Posts: 210
Joined: Fri 23 Feb 2007, 00:03
Location: San Antonio, TX

#5 Post 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

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#6 Post 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.

kirk
Posts: 1553
Joined: Fri 11 Nov 2005, 19:04
Location: florida

#7 Post 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.
Last edited by kirk on Thu 31 Jan 2008, 19:46, edited 1 time in total.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#8 Post 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.
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]

NathanO
Posts: 210
Joined: Fri 23 Feb 2007, 00:03
Location: San Antonio, TX

#9 Post 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

kirk
Posts: 1553
Joined: Fri 11 Nov 2005, 19:04
Location: florida

#10 Post 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.
Attachments
asmixer.gz
asmixer binary
(7.86 KiB) Downloaded 1634 times

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#11 Post 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?
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]

User avatar
MikeLockmoore
Posts: 43
Joined: Sun 26 Nov 2006, 18:29
Location: Near Detroit

#12 Post 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
Mike Lockmoore

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#13 Post 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
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]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#14 Post 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)
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#15 Post 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.
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]

NathanO
Posts: 210
Joined: Fri 23 Feb 2007, 00:03
Location: San Antonio, TX

#16 Post 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

NathanO
Posts: 210
Joined: Fri 23 Feb 2007, 00:03
Location: San Antonio, TX

#17 Post 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

NathanO
Posts: 210
Joined: Fri 23 Feb 2007, 00:03
Location: San Antonio, TX

#18 Post 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.

Rickrandom
Posts: 195
Joined: Sat 21 Jan 2006, 05:35
Location: Bedfordshire, UK

#19 Post 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.
Attachments
battmon.jpg
(2.62 KiB) Downloaded 2044 times

kirk
Posts: 1553
Joined: Fri 11 Nov 2005, 19:04
Location: florida

#20 Post 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?

Post Reply