#!/bin/sh # 10/11/2007 Première version # 17/11/2007 Quitter l'applet PREM=1 askStop() { CMD="zenity --notification --text=\"Quitter l'applet\" --window-icon=/usr/share/icons/Echo/48x48/actions/exit.png" bash -c "$CMD 2>/dev/null" 2>/dev/null & sleep 6 PID=$(ps U $USER|grep "$(echo "$CMD"|sed "s/\"//g")"|grep -v " grep z"|awk -F" " '{ print $1 }'|tail -1) if [ -n "$PID" ]; then kill -9 $PID else exit 0 fi } while [ 1 ]; do if [ -n "$(ps -e|grep -E 'beryl|compiz')" ] || [ $PREM -eq 0 ] ; then zenity --notification --text="Arrête le bureau 3D" --window-icon=/usr/share/icons/Echo/24x24/actions/dialog-close.png startCompositeWM --stop || metacity --replace & askStop fi zenity --notification --text="Lance le bureau 3D" --window-icon=/usr/share/icons/hicolor/24x24/apps/desktop-effects.png startCompositeWM --restart || fusion-icon & askStop PREM=0 done