Bug 67296

Summary: Make battery applet appear conditionally on laptops
Product: [Retired] Red Hat Raw Hide Reporter: Havoc Pennington <hp>
Component: gnome-panelAssignee: Havoc Pennington <hp>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: jirka, pbrown
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-14 16:15:35 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:
Bug Depends On:    
Bug Blocks: 67217    

Description Havoc Pennington 2002-06-21 23:02:29 UTC
I think we aren't adding the battery applet by default on laptops at the moment.

Comment 1 Havoc Pennington 2002-07-10 21:15:07 UTC
see http://bugzilla.gnome.org/show_bug.cgi?id=87873

Comment 2 Preston Brown 2002-08-13 20:32:08 UTC
havoc -- where do default panel contents get defined? I'll take a stab at making
this work.

Comment 3 Havoc Pennington 2002-08-13 21:11:10 UTC
The gnome-panel RPM has a .schemas file redhat-panel-per-panel-config.schemas as
one of the SourceN lines that defines things. Probably what you would do is add
the battery in here (not trivial to figure out, this file is bizarre - I can do
it maybe as I already deciphered it, or just copy something like the
pager_applet entry), and then most likely you will need a bad hack 
in gnome-panel/applet.c:panel_applet_load_idle_handler to intercept a battery
applet and avoid loading it on desktops. But then if the user chooses 
a battery applet from the menu on their desktop, things will silently not work,
so perhaps a more complex change is required.

The see-if-we're-on-a-laptop code is in 1.4 gnome-core in 7.3, it does something
crazy like fork/exec a subprocess because on some laptops any process that 
reads /proc/apm will segfault due to a kernel bug.

Actually screw all that - another possible approach that might work is to have
two .schemas files (hopefully one derived from the other in automated fashion),
and in %post install one or the other based on whether it's a laptop. This is
probably a lot easier and safer in fact. Just change the package to install two
.schemas files, pick one or the other in %post - main hard part is having
some "this_is_a_laptop" command to use in the script.

Comment 4 Preston Brown 2002-08-14 16:15:30 UTC
addressed in gnome-panel-2.0.6-2

Comment 5 Jay Turner 2002-08-31 02:14:03 UTC
This looks solid with gnome-panel-2.0.6-9.