#!/bin/sh
#Barry Kauler 2007

Xdialog --center --title "Glipper clipboard manager" --ok-label "Enable Glipper" --cancel-label "Disable Glipper" --yesno "Glipper is a great little taskbar applet for managing the clipboard.

If you click the 'Enable Glipper' button, then Glipper will appear in
the takbar, and will also start automatically in the future.
If you click the 'Disable Glipper' button, then if Glipper is runnng
it will be terminated now and will not be started in the future." 0 0

RETVAL=$?

if [ $RETVAL -eq 0 ];then
 touch /root/.glipper_on
 PSRUN="`ps`"
 [ "`echo "$PSRUN" | grep -v 'glipper_shell' | grep 'glipper'`" = "" ] && glipper &
 exit
fi

if [ $RETVAL -eq 1 ];then
 rm -f /root/.glipper_on
 killall glipper
 exit
fi
