gnome-cleanup revision 2920
10139N/A#!/bin/sh
10139N/A#
10139N/A# Cleans up Sun's Gnome Desktop user files to return the user
20358N/A# to the default desktop configuration.
10139N/A#
10139N/A# By: Brian Cameron <Brian.Cameron@sun.com>
10139N/A
17185N/A# Check if GNOME is running:
10139N/A#
10139N/Aif [ -z "$LOGNAME" ]; then
17176N/A LOGNAME=`/usr/bin/logname`
17176N/Afi
17176N/AGNOME_PROCESSES='(gnome-session|gconfd|gconfd-2|metacity|esd)'
10139N/ARUNNING_PROCESSES=`/usr/bin/pgrep -l -U $LOGNAME "$GNOME_PROCESSES"`
15322N/A
10139N/Aif [ ! -z "$RUNNING_PROCESSES" ]; then
20832N/A echo "The following GNOME processes are still running:"
11020N/A echo
10139N/A echo "$RUNNING_PROCESSES"
18615N/A echo
10139N/A echo "Please log out from GNOME and stop all your GNOME processes"
10139N/A echo "before running this script."
10139N/A
11207N/A exit 1
16428N/Afi
16428N/A
12786N/A# Files common to Gnome 2.x and Gnome 1.4
19019N/A#
18966N/Agnome_files="$HOME/.gconf $HOME/.gconfd $HOME/.gnome $HOME/.gnome-desktop $HOME/.gnome2 $HOME/.gnome2_private $HOME/.metacity $HOME/.nautilus $HOME/.esd_auth $HOME/.gtkrc $HOME/.nautilus-metafile.xml"
19044N/A
19019N/A# Gnome 1.4 specific files
20118N/A#
20118N/Agnome_14_files="$HOME/.gimp-1.2 $HOME/.gnome-help-browser $HOME/.gnome_private $HOME/.thumbnails $HOME/.themes $HOME/Nautilus"
20832N/A
20832N/Ahas_files=`/bin/ls -1d $gnome_files $gnome_14_files 2> /dev/null`
10139N/A
10139N/Aif [ ! -z "$has_files" ]
10139N/Athen
10139N/A echo ""
10139N/A echo "You currently have the following GNOME configuration files:"
10139N/A echo ""
10139N/A echo "$has_files"
10139N/A echo ""
10139N/A echo "Do you wish to remove these files (Y/N) \c"
10139N/A read input;
10139N/A
10139N/A if [ "$input" = "Y" -o "$input" = "y" ]
10139N/A then
10139N/A /bin/rm -fR $has_files
10139N/A echo "Removed..."
10139N/A else
10139N/A echo "Not removed..."
10139N/A fi
10139N/A echo ""
10139N/Aelse
10139N/A echo ""
10139N/A echo "You do not have any GNOME configuration files."
10139N/A echo ""
10139N/Afi
10139N/A