1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/bash
- dir=~/dotfiles
- olddir=~/dotfiles_old
- files="bashrc vimrc vim zshrc oh-my-zsh private scrotwm.conf Xresources"
- echo -n "Creating $olddir for backup of any existing dotfiles in ~ ..."
- mkdir -p $olddir
- echo "done"
- echo -n "Changing to the $dir directory ..."
- cd $dir
- echo "done"
- for file in $files; do
- echo "Moving any existing dotfiles from ~ to $olddir"
- mv ~/.$file ~/dotfiles_old/
- echo "Creating symlink to $file in home directory."
- ln -s $dir/$file ~/.$file
- done
- function install_zsh {
- if [ -f /bin/zsh -o -f /usr/bin/zsh ]; then
-
- if [[ ! -d $dir/oh-my-zsh/ ]]; then
- git clone http://github.com/michaeljsmalley/oh-my-zsh.git
- fi
-
- if [[ ! $(echo $SHELL) == $(which zsh) ]]; then
- chsh -s $(which zsh)
- fi
- else
-
- platform=$(uname);
-
- if [[ $platform == 'Linux' ]]; then
- sudo apt-get install zsh
- install_zsh
-
- elif [[ $platform == 'Darwin' ]]; then
- echo "Please install zsh, then re-run this script!"
- exit
- fi
- fi
- }
- install_zsh
|