Bug 143828 - Battstat applet should appear by default on desktop if needed
Battstat applet should appear by default on desktop if needed
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gnome-panel (Show other bugs)
3
All Linux
medium Severity low
: ---
: ---
Assigned To: Mark McLoughlin
:
Depends On:
Blocks: FC4Target
  Show dependency treegraph
 
Reported: 2004-12-29 02:07 EST by Christopher Beland
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version: 2.10.1-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-18 06:51:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Christopher Beland 2004-12-29 02:07:56 EST
(sorry if this is the wrong component)

I have Toshiba M35X-S106 laptop, and I did a fresh install of Fedora Core 3. 
When I first saw my desktop, I was disappointed that there was no battery status
applet included.  It was only later that I discovered that it did exist; I just
had to add it myself from a secret menu.

From a usability perspective, it makes sense to automatically include the applet
on the default desktop, if Fedora is being/has been installed on a portable,
battery-powered device like a laptop.

-B.
Comment 1 Mark McLoughlin 2005-01-05 05:59:04 EST
Yeah, the scriptlet in gnome-panel.spec to install the applet on the
default panel only detects when APM is enabled and doesn't do anything
when ACPI is enabled and APM is disabled.
Comment 2 Mark McLoughlin 2005-01-05 08:44:46 EST
So, the APM check looks like:

apm=false
if [ -f /proc/apm ]; then
  # Battery present if top bits are unset
  flag=$(cat /proc/apm | cut -d ' ' -f 6 | sed
's/0x\([0-9a-f]\)[0-9a-f]/\1/')
  if [ "$flag" == "0" ]; then
    apm=true
  fi
fi

Probably want to make it something like:

pm_available=false
if [ -f /proc/acpi/event ] ; then
  for battery in /proc/acpi/battery/*/state; do 
    if grep 'present: *yes' $battery >/dev/null 2>&1; then 
      pm_available=true
    fi
  done
elif [ -f /proc/apm ]; then
  # Battery present if top bits are unset
  flag=$(cat /proc/apm | cut -d ' ' -f 6 | \
             sed  s/0x\([0-9a-f]\)[0-9a-f]/\1/')
  if [ "$flag" == "0" ]; then
    pm_available=true
  fi
fi
Comment 3 Mark McLoughlin 2005-04-18 06:51:48 EDT
Should be fixed in rawhide now:

* Mon Apr 18 2005 Mark McLoughlin <markmc@redhat.com> 2.10.1-2
- Add the battery applet to the panel in %post if ACPI is
  available (bug #143828)
Comment 4 Christopher Beland 2007-08-26 15:06:20 EDT
Confirmed that this is fixed as of Fedora 7.  Yay!

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