2920
|
1 |
#!/bin/sh
|
|
2 |
#
|
|
3 |
# Cleans up Sun's Gnome Desktop user files to return the user
|
|
4 |
# to the default desktop configuration.
|
|
5 |
#
|
|
6 |
# By: Brian Cameron <[email protected]>
|
|
7 |
|
|
8 |
# Check if GNOME is running:
|
|
9 |
#
|
|
10 |
if [ -z "$LOGNAME" ]; then
|
|
11 |
LOGNAME=`/usr/bin/logname`
|
|
12 |
fi
|
|
13 |
GNOME_PROCESSES='(gnome-session|gconfd|gconfd-2|metacity|esd)'
|
|
14 |
RUNNING_PROCESSES=`/usr/bin/pgrep -l -U $LOGNAME "$GNOME_PROCESSES"`
|
|
15 |
|
|
16 |
if [ ! -z "$RUNNING_PROCESSES" ]; then
|
|
17 |
echo "The following GNOME processes are still running:"
|
|
18 |
echo
|
|
19 |
echo "$RUNNING_PROCESSES"
|
|
20 |
echo
|
|
21 |
echo "Please log out from GNOME and stop all your GNOME processes"
|
|
22 |
echo "before running this script."
|
|
23 |
|
|
24 |
exit 1
|
|
25 |
fi
|
|
26 |
|
|
27 |
# Files common to Gnome 2.x and Gnome 1.4
|
|
28 |
#
|
|
29 |
gnome_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"
|
|
30 |
|
|
31 |
# Gnome 1.4 specific files
|
|
32 |
#
|
|
33 |
gnome_14_files="$HOME/.gimp-1.2 $HOME/.gnome-help-browser $HOME/.gnome_private $HOME/.thumbnails $HOME/.themes $HOME/Nautilus"
|
|
34 |
|
|
35 |
has_files=`/bin/ls -1d $gnome_files $gnome_14_files 2> /dev/null`
|
|
36 |
|
|
37 |
if [ ! -z "$has_files" ]
|
|
38 |
then
|
|
39 |
echo ""
|
|
40 |
echo "You currently have the following GNOME configuration files:"
|
|
41 |
echo ""
|
|
42 |
echo "$has_files"
|
|
43 |
echo ""
|
|
44 |
echo "Do you wish to remove these files (Y/N) \c"
|
|
45 |
read input;
|
|
46 |
|
|
47 |
if [ "$input" = "Y" -o "$input" = "y" ]
|
|
48 |
then
|
|
49 |
/bin/rm -fR $has_files
|
|
50 |
echo "Removed..."
|
|
51 |
else
|
|
52 |
echo "Not removed..."
|
|
53 |
fi
|
|
54 |
echo ""
|
|
55 |
else
|
|
56 |
echo ""
|
|
57 |
echo "You do not have any GNOME configuration files."
|
|
58 |
echo ""
|
|
59 |
fi
|