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