#!/bin/sh
# Install the .rc files for the sample desktop.
#
S=/usr/share/skel/examples/cfbsd/scripts
while [ 1 ]; do
  echo Enter the name of a user to install the desktop configuration files.
  echo Press \'Enter\' to stop
  echo -n "User ID: "
  read user
  if [ "$user" = "" ]; then
    exit
  fi 
  dir=`grep $user /etc/passwd | head -n1 | awk -F : '{print $6}'`
  group=`grep $user /etc/passwd | head -n1 | awk -F : '{print $4}'`
  echo cp -p $S/.xinitrc $S/.fvwm2rc $dir
  cp -p $S/.xinitrc $S/.fvwm2rc $dir
  echo chown $user.$group $dir/.xinitrc $dir/.fvwm2rc
  chown $user.$group $dir/.xinitrc $dir/.fvwm2rc
done
