You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, November 28th 2006, 2:46pm

Updating icons on the taskbar

I hope this is the correct category for my problem. If not, please send me in the right direction.

I have a small application that I would like to have reflect a status through the icon it displays. I can make this work just fine as long as the icon is placed on the desktop, but id I place it on the taskbar it stops updating.

Here is a short script that I (I hope) explains what I mean. If you place this script in your crontab to be run every minute, then the icon on the desktop updates, but the icon on the taskbar does not:
#!/bin/sh -x
## Test on how to switch icons on condition

ICONFILE=$HOME/Desktop/DATA_STATUS.desktop
KICKERFILE=$HOME/.kde/share/apps/kicker/DATA_STATUS-2.desktop
minute=`date +%M`
remainder=`expr $minute % 2`

if [ $remainder == 1 ]; then
# echo "$minute is an odd number"
sed s/Icon=error/Icon=gnome-favorites/g $ICONFILE > /tmp/qwe.$$
else
# echo "$minute is an even number"
sed s/Icon=gnome-favorites/Icon=error/g $ICONFILE > /tmp/qwe.$$
fi
mv /tmp/qwe.$$ $ICONFILE
cp $ICONFILE $KICKERFILE

##### End script

I think the problem may be that I don't know how to refreash the taskbar.
Any help would be much appreciated!
-- pgholm