2 ############################
4 # Create symlinks from the home directory to dotfiles in ~/etc/dotfiles
5 ############################
10 olddir=~/etc/dotfiles.bak
11 files="vimrc bashrc xsession Xresources gitconfig zprofile zshenv zshrc xinitrc"
15 # create dotfiles_old in homedir
16 echo -n "Creating $olddir for backup of any existing dotfiles in ~ ..."
20 # change to the dotfiles directory
21 echo -n "Changing to the $dir directory ..."
25 # move any existing dotfiles in homedir to dotfiles_old directory,
26 #then create symlinks from the homedir to any files in the
27 #~/dotfiles directory specified in $files
28 for file in $files; do
29 echo "Moving any existing dotfiles from ~ to $olddir"
31 echo "Creating symlink to $file in home directory."
32 ln -s $dir/$file ~/.$file