[K12OSN] reset-all-desktops

Will Hatch fhkms at adelphia.net
Tue Sep 27 17:46:45 UTC 2005


I found this script while researching a way to reset my students desktops everytime they log off and then log back on:

#!/bin/sh
#
# A simple script to reset a specific user's desktop settings
#

if [ ! "$1" ]
then
	echo
	echo "usage: $0 <username>"
	echo
	exit
fi

HOMEDIR=`eval "echo ~$1"`

cd $HOMEDIR || { 
	echo
	echo "Ack! the home directory of $1 was not found, aborting"
	echo
	exit
}

# out with the old
for dir in .kde .gnome_private .gconfd .gconf .nautilus .gnome-desktop .gtkrc \
           .sawfish .gnome
do
	if [ -d $HOMEDIR/$dir ]
	then
		rm -rf $HOMEDIR/$dir &> /dev/null
	fi
done
for file in .screenrc 
do
	if [ -f $HOMEDIR/$file ]
	then
		rm -rf $HOMEDIR/$file &> /dev/null
	fi
done

# in with the new
for new in .screenrc .gtkrc .kde .gnome-desktop
do
	cp -a /etc/skel/$new $HOMEDIR/ &> /dev/null
	chown -R --reference=$HOMEDIR $HOMEDIR/$new &> /dev/null
done


What do I have to do to it to make it so the default gnome desktop is restored after every logoff/login?  Thanks




More information about the K12OSN mailing list