Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have installed LXDE on Debian (LXDE metapackage). I have also installed some additional themes and icons, but when I chage the icons, the battery icon in the task bar stays the same (basically just an ugly green rectange, that does not look anything like a battery).

This is how it currently looks like:

enter image description here

UPDATE:

I have installed nice icon set, where there are icons of battery in several stages of charging/discharging. I am wondering whether it is possible to change my lxpanel configuration, so that it displays icons instead of the green rectangle.

Following is the relevant code from my ~/.config/lxpanel/LXDE/panels/panel

Plugin {
    type = batt
    Config {
        HideIfNoBattery=0
        AlarmCommand=xmessage Battery low
        AlarmTime=5
        BackgroundColor=black
        BorderWidth=1
        ChargingColor1=#28f200
        ChargingColor2=#22cc00
        DischargingColor1=#ffee00
        DischargingColor2=#d9ca00
        Size=12
    }
}
share|improve this question
1  
In Lubuntu, a distro which uses LXDE (and the lxpanel), the default icon theme has a subfolder called "panel" which has several battery icons corresponding to various stages of charging and discharging. Without knowing more about your setup, it's difficult to say more. –  user15760 Jun 2 '13 at 17:07
    
Please remember to award the bounty. I have assumed in my answer that you want to know why a theme does not edit the default lxpanel battery monitor plugin's appearance (the plugin shown in your question) and what the available options are for changing the display of your battery's status. –  RyanLoremIpsum Oct 17 at 0:44

1 Answer 1

up vote 4 down vote accepted
+100

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.

Battery Monitor settings

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

share|improve this answer
1  
I know about gnome-power-manager. It has nice icon, but the problem is it has too many dependencies. I am using LXDE exactly to avoid the evil dependencies that gnome applications require. –  user1968963 Oct 17 at 0:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.