#!/bin/sh
# hack to fix the icewm taskbar location - ("icewm" "TaskBar")  640x33+0+0  +0+447
if [ "$1" = "" ]; then
  chkhinge
  xrandr -o left
  xrandr -o normal
fi

WINID=`xwininfo -root -tree|grep TaskBar|awk '{print $1}'`
for i in `ps -ef|grep applet|grep mb`
do
	killall $i 2>/dev/null
done
killall glipper 2>/dev/null
wmctrl -i -r $WINID -e 0,0,447,640,33
glipper 2>/dev/null &
#for x in `grep applet /usr/bin/ice-session|grep -v "#"|grep -v tasks|cut -d" " -f1`
#do
#  $x 2>/dev/null &
#done
if [ -f ~/.icewm/icedock ]; then
  ICEDOCK=~/.icewm/icedock
else
  ICEDOCK=/etc/icewm/icedock
fi

if [ -f $ICEDOCK ]; then
  for i in `cat $ICEDOCK`
  do
    $i 2>/dev/null >/dev/null &
  done
fi		
exit 0
