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