Bug 67296 - Make battery applet appear conditionally on laptops
Make battery applet appear conditionally on laptops
Product: Red Hat Raw Hide
Classification: Retired
Component: gnome-panel (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Havoc Pennington
Depends On:
Blocks: 67217
  Show dependency treegraph
Reported: 2002-06-21 19:02 EDT by Havoc Pennington
Modified: 2008-05-01 11:38 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-08-14 12:15:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Havoc Pennington 2002-06-21 19:02:29 EDT
I think we aren't adding the battery applet by default on laptops at the moment.
Comment 1 Havoc Pennington 2002-07-10 17:15:07 EDT
see http://bugzilla.gnome.org/show_bug.cgi?id=87873
Comment 2 Preston Brown 2002-08-13 16:32:08 EDT
havoc -- where do default panel contents get defined? I'll take a stab at making
this work.
Comment 3 Havoc Pennington 2002-08-13 17:11:10 EDT
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 12:15:30 EDT
addressed in gnome-panel-2.0.6-2
Comment 5 Jay Turner 2002-08-30 22:14:03 EDT
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.