Battery power monitor on desktop


Forum: User Feedback
Topic: Battery power monitor on desktop
started by: setecio

Posted by setecio on April 11 2007,15:36
Where can I find details of how the battery monitor on the desktop works, or the scripts used for it. It works great on my laptop and am wondering if I can see how it works and what bits of the laptop it gets it's info from. I'm trying to get a battery applet on Puppy Linux to work but it won't whereas the DSL one works great. Thanks.
Posted by ^thehatsrule^ on April 11 2007,21:31
It's a program called torsmo.  See ~/.torsmorc
There's also an updated fork of torsmo called conky.

Posted by WDef on April 11 2007,22:06
You can look at my torsmo script here:

< http://damnsmalllinux.org/cgi-bin....t=18266 >

As you can see the information about the level of charge comes from some pseudofiles written to by ACPI.

Posted by setecio on April 11 2007,22:39
Thanks for that. Is it always done by ACPI ?

How do I view ~/.torsmorc          ....(and conky if possible)

I mounted the DSL partition, opened emelfm and looked for /.torsmorc. Beginners info required, but do I look in a certain folder, do I need to unhide files somehow. Probably easy but I'm stuck.

Posted by ^thehatsrule^ on April 12 2007,01:13
apm and acpi, I think, are the 2 standards.

That's in ~/ , and not /
~ means the user's home directory (ie /home/dsl ) and is autoexpanded if used.
If you wish to view it in emelfm, hit ctrl+h or the "H" button.

Posted by setecio on April 12 2007,08:58
From .torsmorc
Quote
${color #ddd}Battery:  $color ${battery}


So it is displaying the percentage represented by {battery}
Is there any code for how {battery} gets the percentage figure, a script or something ? If so where can I read it. I'm looking for how it actually calculates or finds the percentage remaining. Thanks.

Posted by Juanito on April 12 2007,09:04
I would guess it is getting this by calculation from a combination of:

/proc/acpi/battery/BAT0/info
and
/proc/acpi/battery/BAT0/state

Posted by setecio on April 12 2007,09:07
On my laptop, in terminal :
Quote
cat /proc/acpi/battery

gives cannot open file - no such file or directory
so I think mine is using apm, where would it calculate it from with apm ?

Posted by Juanito on April 12 2007,09:14
If your laptop uses apm, sorry - I have no idea.

In case your laptop uses acpi, is it disabled by a boot code? Is the battery module loaded?

Posted by setecio on April 12 2007,09:34
When DSL boots up it says in Blue
Quote
Skipping APM bios detection as requested on boot command line


Boot command is
Quote
kernel /boot/linux24 root=/dev/hda3 quiet vga=788 noacpi noapm nodma nosci frugal
initrd /boot/minirt24.gz

Posted by Juanito on April 12 2007,10:52
You could try deleting "noacpi" and see what happens when you re-boot. If this hangs your laptop or does not load the acpi modules then you could put back "noacpi" and try deleting "noapm" and re-booting.

Note also, "nosci" should probably read "noscsi"

Posted by ^thehatsrule^ on April 12 2007,13:23
If it already works as-is, you could always check out the torsmo source code.
Posted by setecio on April 12 2007,15:56
I found a torsmo.pup for Puppy and it works perfectly.  :D Thanks.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.