Bug 119431 - Battery Charge Monitor applet not present by default
Battery Charge Monitor applet not present by default
Product: Fedora
Classification: Fedora
Component: gnome-panel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Mark McLoughlin
Depends On:
  Show dependency treegraph
Reported: 2004-03-30 08:53 EST by Michael Opdenacker
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version: 2.6.0-5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-04-08 10:36:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michael Opdenacker 2004-03-30 08:53:10 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312

Description of problem:

I've just installed FC2 Test2 without major issues. Great work!
There are just a few minor ones though...

In particular, the "Battery Charge Monitor" Gnome applet
is not present by default. It's easy to add it by doing
"Add to Panel" -> "Utility" -> "Battery Charge Monitor"
with the right mouse button on the Gnome panel.

In KDE, such an applet is there by default, which should
be the right behaviour when a battery is reported by the
system (i'm using the default settings: apm). No need to
say that most laptop users are used to having this by default
and will consider not having it as a bug.

Could you fix this please? I hope I reported this bug on the
right component name. Don't hesitate to fix it if needed!



Version-Release number of selected component (if applicable):

How reproducible:
Didn't try

Steps to Reproduce:
On a laptop, login to a new user account (chosing Gnome)

Actual Results:  See that there is no battery monitor applet on the
Gnome panel.

Additional info:
Comment 1 Mark McLoughlin 2004-03-30 09:27:16 EST
What does `cat /proc/apm` show ?
Comment 2 Michael Opdenacker 2004-03-30 09:47:21 EST
Hi Mark!

Thanks for helping on this issue!

Here are the contents of /proc/apm:

AC power:
1.16ac 1.2 0x03 0x01 0x03 0x09 97% -1 ?

Battery power:
1.16ac 1.2 0x03 0x00 0x00 0x01 97% -1 ?

Hope it helps.



Comment 3 Mark McLoughlin 2004-04-08 09:05:39 EDT
What's going on here is that you're bios doesn't support reporting the
actual time remaining on the battery and that's what the "-1 ?" bit in
/proc/apm is about.

When the panel is being installed, it currently uses this heuristic to
figure out whether to have the battery applet on the panel:

if [ -f /proc/apm ]; then
  mins=`cat /proc/apm|awk '{ print $8 }'`
  if [ "$mins" != "-1" ]; then

and so, that's why its not on your panel by default. Looking though
arch/i386/kernel/apm.c:apm_get_info() I'm thinking the "Battery flag"
bitfield sounds like the most reliable way to get what we want:

           5) Battery flag
              bit 0: High
              bit 1: Low
              bit 2: Critical
              bit 3: Charging
              bit 7: No system battery
              0xff: Unknown

i.e. if it is 0x80 or 0xff we shouldn't have the applet on the panel
because its a desktop machine that supports APM or something.

So, I'd change it to

if [ -f /proc/apm ]; then
  # Battery present if top bits are unset
  flag=`cat /proc/apm|cut -d' ' -f6|sed's/0x\([0-9a-f]\)[0-9a-f]/\1/'`
  if [ "$flag" != "0" ]; then
Comment 4 Mark McLoughlin 2004-04-08 10:36:07 EDT
Fix is in gnome-panel-2.6.0-5 which will appear in Raw Hide soon.
Re-open the bug if it doesn't work for you.

* Thu Apr  8 2004 Mark McLoughlin <markmc@redhat.com> 2.6.0-5
- Fix problem with apm detection in %post on machines whose
  APM bios doesn't have battery lifetime support
Comment 5 Michael Opdenacker 2004-04-09 05:07:04 EDT
Hi Mark!

Thanks a lot for this!

I will test it as soon as version 2.6.0-5 is available
(so far I still see only 2.6.0-4).

Thanks again!


Comment 6 Michael Opdenacker 2004-04-28 11:14:19 EDT
Confirmed that this no longer happens on FC2 T3
Thanks again!



Note You need to log in before you can comment on or make changes to this bug.