LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Missing xfce4-power-manager icons in Xfce 4.8 (http://www.linuxquestions.org/questions/slackware-14/missing-xfce4-power-manager-icons-in-xfce-4-8-a-888379/)

CTM 06-25-2011 08:22 PM

Missing xfce4-power-manager icons in Xfce 4.8
 
3 Attachment(s)
I'm using Slackware64 13.37 with Robby's Xfce 4.8 build on a laptop with two batteries. I've noticed that when the charge for one battery is depleted, the empty battery icon for the xfce4-power-manager panel applet is displayed as an "image missing" icon (see the attachments for screenshots of how this progresses).

Is this just down to a missing image, or is it more subtle than that? Has anyone else had the same problem, and if so how did you fix it? So far I've tried clearing the GTK+ icon cache and reinstalling the hicolor icon theme package as suggested in other threads in this forum, but nothing changed.

rmjohnso 06-25-2011 09:37 PM

What happens if you select a different icon theme?

yuuko 06-26-2011 03:42 AM

1 Attachment(s)
After the battery is drained, the icon should turn into a red one.

CTM 06-26-2011 07:47 AM

Quote:

Originally Posted by rmjohnso (Post 4395834)
What happens if you select a different icon theme?

I have two themes installed here, Gnome and Tango. The icon appears as a missing image icon regardless of which of these themes I choose.

Quote:

Originally Posted by yuuko (Post 4395942)
After the battery is drained, the icon should turn into a red one.

For me it does do this between 1% and about 20% - the 3-attachment limit prevented me from posting that screenshot though :)

yuuko 06-26-2011 08:07 AM

You might try Faenza or elementary icons and see how it works, since neither Gnome nor Tango contains the corresponding status icons for xfce4-power-manager. IMHO, there's probably a bug that xfce doesn't get the right status of the drained battery.

CTM 06-26-2011 02:28 PM

Quote:

Originally Posted by yuuko (Post 4396053)
You might try Faenza or elementary icons and see how it works, since neither Gnome nor Tango contains the corresponding status icons for xfce4-power-manager. IMHO, there's probably a bug that xfce doesn't get the right status of the drained battery.

Almost - after digging around some more I found that there's an unanswered bug against xfce4-power-manager about this. There's a patch on the Debian bug tracker that fixes the problem (a function in xfce4-power-manager doesn't return the name of an icon to display when the battery charge is at 0%). I guess it went unnoticed because of the small number of Xfce users who have multiple-battery laptops.

In case anyone else has the same issue, I've attached a copy of the patch and an updated SlackBuild for Robby's Xfce 4.8 package:

xfpm-empty-battery-icon.patch (save in same directory as SlackBuild):
Code:

diff -ruN xfce4-power-manager-1.0.10-orig/src/xfpm-battery.c xfce4-power-manager-1.0.10/src/xfpm-battery.c
--- xfce4-power-manager-1.0.10-orig/src/xfpm-battery.c        2011-02-15 15:58:47.000000000 +0200
+++ xfce4-power-manager-1.0.10/src/xfpm-battery.c        2011-06-05 21:25:42.000000000 +0300
@@ -302,8 +302,7 @@
                        xfpm_battery_get_icon_index (battery->priv->type, battery->priv->percentage),
                        "charging");
        }
-        else if ( battery->priv->state == XFPM_DEVICE_STATE_DISCHARGING ||
-                  battery->priv->state == XFPM_DEVICE_STATE_PENDING_DISCHARGING)
+        else
        {
            g_snprintf (icon_name, 128, "%s%s",
                        battery->priv->icon_prefix,
@@ -320,7 +319,7 @@
        {
            g_snprintf (icon_name, 128, "%s-100", battery->priv->icon_prefix);
        }
-        else if ( battery->priv->state == XFPM_DEVICE_STATE_DISCHARGING )
+        else
        {
            g_snprintf (icon_name, 128, "%s-%s",
                        battery->priv->icon_prefix,

xfce4-power-manager.SlackBuild:

Code:

#!/bin/sh

# Slackware build script for xfce4-power-manager

# Copyright 2006-2010  Robby Workman  Northport, Alabama, USA
# Copyright 2009, 2010  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


PKGNAM=xfce4-power-manager
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i486 ;;
    arm*) export ARCH=arm ;;
      *) export ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP || exit 1
rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
cd $PKGNAM-$VERSION || exit 1
# fix for missing empty battery icon: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629265#70
cat $CWD/xfpm-empty-battery-icon.patch | patch -p1 || exit 1
chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

CFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc/xfce \
  --mandir=/usr/man \
  --docdir=/usr/doc/$PKGNAM-$VERSION \
  --enable-shared=yes \
  --enable-static=no \
  --enable-debug=no \
  --enable-network-manager \
  --build=$ARCH-slackware-linux

make || exit 1
make install DESTDIR=$PKG

find $PKG | xargs file | grep -e "executable" -e "shared object" \
  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

gzip -9 $PKG/usr/man/man?/*.?

mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/html
cp -a \
  AUTHORS COPYING NEWS README TODO \
    $PKG/usr/doc/$PKGNAM-$VERSION
( cd $PKG/usr/doc/$PKGNAM-$VERSION/html
  ln -s /usr/share/xfce4/doc/C/xfce4-power-manager.html index.html
  ln -s /usr/share/xfce4/doc/C/images .
)

# If there's a ChangeLog, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r ChangeLog ]; then
  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
  touch -r ChangeLog $DOCSDIR/ChangeLog
fi

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz



All times are GMT -5. The time now is 12:25 AM.