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 Thu 23 Oct 2014, 05:07
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Battery monitor for Dingo Alpha5
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 4 [54 Posts]   Goto page: 1, 2, 3, 4 Next
Author Message
kirk

Joined: 11 Nov 2005
Posts: 1419
Location: florida

PostPosted: Sun 27 Jan 2008, 17:03    Post subject:  Battery monitor for Dingo Alpha5  

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?applet=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.
shot2.png
 Description   Hacked version
 Filesize   4.23 KB
 Viewed   4278 Time(s)

shot2.png

Dingo-battery.pet
Description  Pet package
pet

 Download 
Filename  Dingo-battery.pet 
Filesize  14.63 KB 
Downloaded  1840 Time(s) 
asapm-3.1.1.tar.gz
Description  Hacked source. Not needed for testing.
gz

 Download 
Filename  asapm-3.1.1.tar.gz 
Filesize  62.53 KB 
Downloaded  1225 Time(s) 

Last edited by kirk on Mon 28 Jan 2008, 10:07; edited 2 times in total
Back to top
View user's profile Send private message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Sun 27 Jan 2008, 20:55    Post subject:  

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).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
kirk

Joined: 11 Nov 2005
Posts: 1419
Location: florida

PostPosted: Sun 27 Jan 2008, 21:13    Post subject:  

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.
shot1.png
 Description   Old version with half of battery slider showing and time remaining off the bottom of the screen.
 Filesize   4.07 KB
 Viewed   4132 Time(s)

shot1.png


Last edited by kirk on Mon 28 Jan 2008, 10:09; edited 1 time in total
Back to top
View user's profile Send private message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Sun 27 Jan 2008, 22:14    Post subject:  

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).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
NathanO

Joined: 22 Feb 2007
Posts: 198
Location: San Antonio, TX

PostPosted: Sun 27 Jan 2008, 23:11    Post subject:  

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
Back to top
View user's profile Send private message 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Mon 28 Jan 2008, 00:46    Post subject:  

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.
Back to top
View user's profile Send private message 
kirk

Joined: 11 Nov 2005
Posts: 1419
Location: florida

PostPosted: Mon 28 Jan 2008, 10:07    Post subject:  

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, 15:46; edited 1 time in total
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Mon 28 Jan 2008, 12:13    Post subject:  

Kirk,
I am trying to compile this in alpha 4
Code:
./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: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
NathanO

Joined: 22 Feb 2007
Posts: 198
Location: San Antonio, TX

PostPosted: Mon 28 Jan 2008, 14:22    Post subject:  

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
Back to top
View user's profile Send private message 
kirk

Joined: 11 Nov 2005
Posts: 1419
Location: florida

PostPosted: Mon 28 Jan 2008, 21:01    Post subject:  

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.
asmixer.gz
Description  asmixer binary
gz

 Download 
Filename  asmixer.gz 
Filesize  7.86 KB 
Downloaded  1136 Time(s) 
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Mon 28 Jan 2008, 23:20    Post subject:  

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: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
MikeLockmoore


Joined: 26 Nov 2006
Posts: 43
Location: Near Detroit

PostPosted: Tue 29 Jan 2008, 13:39    Post subject:
Subject description: Will it work for pre-Dingo pups?
 

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
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Tue 29 Jan 2008, 14:24    Post subject:  

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:
<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:
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: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Tue 29 Jan 2008, 18:25    Post subject:
Subject description: Will it work for pre-Dingo pups?
 

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).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Tue 29 Jan 2008, 19:57    Post subject:  

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: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 4 [54 Posts]   Goto page: 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
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.0842s ][ Queries: 13 (0.0082s) ][ GZIP on ]