LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 06-25-2011, 09:22 PM   #1
CTM
Member
 
Registered: Apr 2004
Distribution: Slackware64 14.0 / 14.1
Posts: 131

Rep: Reputation: 50
Missing xfce4-power-manager icons in Xfce 4.8


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.
Attached Images
File Type: png battery-blue.png (3.5 KB, 15 views)
File Type: png battery-orange.png (3.8 KB, 16 views)
File Type: png battery-empty.png (3.5 KB, 15 views)

Last edited by CTM; 06-25-2011 at 09:24 PM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 06-25-2011, 10:37 PM   #2
rmjohnso
Member
 
Registered: Mar 2006
Location: Wisconsin
Distribution: Slackware64-Current
Posts: 294

Rep: Reputation: 43
What happens if you select a different icon theme?
 
Old 06-26-2011, 04:42 AM   #3
yuuko
Member
 
Registered: May 2011
Distribution: Slackware-current
Posts: 42

Rep: Reputation: 20
After the battery is drained, the icon should turn into a red one.
Attached Images
File Type: png xfpm-primary-000.png (909 Bytes, 66 views)
 
Old 06-26-2011, 08:47 AM   #4
CTM
Member
 
Registered: Apr 2004
Distribution: Slackware64 14.0 / 14.1
Posts: 131

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by rmjohnso View Post
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 View Post
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

Last edited by CTM; 06-27-2011 at 08:00 AM.
 
Old 06-26-2011, 09:07 AM   #5
yuuko
Member
 
Registered: May 2011
Distribution: Slackware-current
Posts: 42

Rep: Reputation: 20
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.
 
Old 06-26-2011, 03:28 PM   #6
CTM
Member
 
Registered: Apr 2004
Distribution: Slackware64 14.0 / 14.1
Posts: 131

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by yuuko View Post
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

Last edited by CTM; 06-26-2011 at 03:30 PM.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XFCE4 Settings Manager missing an icon edwardp Debian 18 03-16-2011 12:28 PM
[SOLVED] xfce4-power-manager-1.0.1 and no battery options rmjohnso Slackware 3 10-18-2010 11:01 PM
hooks in xfce4-power-manager TwinReverb Linux - Desktop 1 09-21-2009 06:44 AM
XFCE Power Manager mlpa Slackware 1 09-01-2009 04:29 AM
upgrade to slackware 12.2 + xfce4.6 (xfce4-power-manager doesn't work) zux Slackware 4 04-22-2009 12:28 PM


All times are GMT -5. The time now is 08:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration