Bug 143828 - Battstat applet should appear by default on desktop if needed
Summary: Battstat applet should appear by default on desktop if needed
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-panel
Version: 3
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Mark McLoughlin
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC4Target
TreeView+ depends on / blocked
 
Reported: 2004-12-29 07:07 UTC by Christopher Beland
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version: 2.10.1-2
Clone Of:
Environment:
Last Closed: 2005-04-18 10:51:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Christopher Beland 2004-12-29 07:07:56 UTC
(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 10:59:04 UTC
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 13:44:46 UTC
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 10:51:48 UTC
Should be fixed in rawhide now:

* Mon Apr 18 2005 Mark McLoughlin <markmc> 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 19:06:20 UTC
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.