Bug 67296 - Make battery applet appear conditionally on laptops
Summary: Make battery applet appear conditionally on laptops
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: gnome-panel
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 67217
TreeView+ depends on / blocked
 
Reported: 2002-06-21 23:02 UTC by Havoc Pennington
Modified: 2008-05-01 15:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-08-14 16:15:35 UTC
Embargoed:


Attachments (Terms of Use)

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.


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