The applet for the Battery Monitor plugin does not use a simple icon. It draws a 2D vector graphic using the Cairo library. You can only edit the panel item's appearance within the limits provided by the plugin, which does not currently include an option for replacing it with an icon.
It's normal that themes do not affect this panel item's appearance because, afaik, editing the package's source at lxpanel-<version>/plugins/batt/batt.c
and installing your new custom version is the only way to make dramatic changes beyond what the plugin's settings currently allow for. Alternatively, you would have to find a different battery monitor plugin or write your own if you want to see any major changes here.
Editing Battery Monitor's Appearance Settings:
Editing the file ~/config/lxpanel/LXDE/panels/panel.config
directly does not immediately update or refresh the appearance of the battery monitor panel item.
Instead, right-click the battery monitor applet and select "Battery Monitor" Settings
(where you'll notice it's actually two ugly green rectangles). The plugin should apply the new configuration and update the display of the widget upon closing this window.
Using a Different Plugin:
Some plugins, such as the GNOME Power Manager, can be themed by use of static icon images. From the officieal GNOME Power Manager project site:
The notification icon can display a device in the tray. The icons can
be themed with custom icons for each theme, or fallback to a standard
default.
This should allow you to use your theme's icons. Install it with apt-get.
apt-get install gnome-power-manager
You may or may not need to manually add @gnome-power-manager
to your /etc/xdg/lxsession/LXDE/autostart file. If you have any problems, please create a new question that pertains to Gnome Power Manager specifically.
Writing your own battery monitor plugin:
The details of writing your own plugin are beyond the scope of this question, but for those interested and willing to code a bit, see How to write plugins for LXPanel - LXDE.org and Debian - How to monitor battery capacity. As mentioned before, the battery monitor plugin included with the lxde-common package relies on the Cairo library. A good tutorial for working with that can be found at Cairo graphics tutorial.
The bounty requests: "Looking for an answer drawing from credible and/or official sources."
I am looking at the source for this plugin from lxpanel-0.7.1 downloaded at LXDE - Lightweight X Desktop Environment - Browse /LXPanel (desktop panel) at SourceForge.net
Openbox will give the functionality you are looking for to windows whose _OB_APP_TYPE
property is set to "desktop" (You can use obxprop
to check the properties of a window).
So we need to set the _OB_APP_TYPE
for your terminator window to "desktop" so that this will happen.
Reading through the openbox source code, in client.c
I could see that _OB_APP_TYPE
is inherited from _NET_WM_WINDOW_TYPE
. So I looked for an application that could change _NET_WM_WINDOW_TYPE
. The application I found is called devilspie
.
First, install it:
sudo apt-get install devilspie
Next, we'll create the folder for devilspie
configuration files:
mkdir ~/.devilspie
Now we will add a config file that tells devilspie
to look for applications named terminator
and set the window type of them to desktop
. Put the following into ~/.devilspie/terminator.ds
:
(if
(is (application_name) "terminator")
(begin
(wintype "desktop")
)
)
Now, if you run devilspie
(or devilspie -a
to affect existing windows instead of just newly created ones) you'll notice if you use obxprop
on terminator that _NET_WM_WINDOW_TYPE
has changed, but _OB_APP_TYPE
has not yet. Let's use xdotool
to unmap and remap the window (in X11 terminology this means we will stop drawing and begin drawing the window), which should force openbox to notice the value.
Install xdotool:
sudo apt-get install xdotool
Then we run the following script to find the terminator
window, unmap it, wait until it has been unmapped, then remap it. We also resize the window because when it was unmapped and remapped it lost its maximization:
xdotool search --class "terminator" windowunmap --sync windowmap windowsize %1 1024 768
Replace 1024 768
with your resolution. Also note that newer versions of xdotool
than those found in Debian's apt repo support using 100% 100%
instead of a static resolution. You can find .deb
packages for newer versions of xdotool
at xdotool's googlecode page.
The terminator window will immediately become undecorated, and if you now use obxprop
, you will see that both values have been set properly. If you now press the key you bound ToggleShowDesktop
to a few times, the terminator window will always stay active.
To make this persistent, you'll want to run these commands on login. The LXDE Wiki Page for LXSession shows several different ways to do this (global, per-user, per-profile, etc). Assuming you want these settings just for your user and under the LXDE profile (the default), you'll want to edit ~/.config/lxsession/LXDE/autostart
and add the commands we ran, keeping in mind that the xdotool command needs to be run after terminator's window has been rendered, so do something like (sleep 1s & xdotool ...)
. You could also set these commands up as keybinds in openbox if you wish.
Best Answer
I had similar issue in
LXDE
. After some investigation, I found out that this setting comes fromgtk
theme.Go to your gtk theme, ie
/usr/share/themes/<your_theme_name>/gtk-2.0/gtkrc
And find the "button" section. Add the following
bg[ACTIVE]
line:adjust the color code
#804c44
as appropriate.