Bug 119431
Summary: | Battery Charge Monitor applet not present by default | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Michael Opdenacker <michael> |
Component: | gnome-panel | Assignee: | Mark McLoughlin <markmc> |
Status: | CLOSED RAWHIDE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | rawhide | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | 2.6.0-5 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-04-08 14:36:07 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Michael Opdenacker
2004-03-30 13:53:10 UTC
What does `cat /proc/apm` show ? 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. :-) Michael. 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: apm=false if [ -f /proc/apm ]; then mins=`cat /proc/apm|awk '{ print $8 }'` if [ "$mins" != "-1" ]; then apm=true fi fi 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 apm=false 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 apm=true fi fi 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> 2.6.0-5 - Fix problem with apm detection in %post on machines whose APM bios doesn't have battery lifetime support 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! Cheers, Michael. Confirmed that this no longer happens on FC2 T3 Thanks again! :-) Michael |