2014-09-01 16:17:38 -04:00
|
|
|
ABSPATH=$(cd "$(dirname "$0")/.."; pwd)
|
2014-07-18 17:04:46 -04:00
|
|
|
while getopts ":hbsdtclw" VALUE "$@"; do
|
2014-06-22 23:14:05 -04:00
|
|
|
if [ "$VALUE" = "h" ] ; then
|
|
|
|
echo "sync.sh syncs configuration files, applications, and Vim bundles between computers"
|
|
|
|
echo " -h Shows this help"
|
|
|
|
echo " -b Syncs Vim bundles"
|
|
|
|
echo " -s Syncs computer with server applications in server.txt"
|
|
|
|
echo " -d Syncs computer with desktop applications in desktop.txt"
|
|
|
|
echo " -t Syncs tmux configuration file"
|
|
|
|
echo " -c Syncs other configuration files"
|
|
|
|
fi
|
2014-06-16 23:13:57 -04:00
|
|
|
if [ "$VALUE" = "b" ] ; then
|
|
|
|
mkdir -p ~/.vim/plugin/
|
|
|
|
mkdir -p ~/.vim/backup/
|
|
|
|
mkdir -p ~/.vim/undo/
|
|
|
|
mkdir -p ~/.vim/tmp/
|
|
|
|
mkdir -p ~/.vim/bundle/
|
|
|
|
mkdir -p ~/.vim/bundle/
|
|
|
|
echo "Installing vim bundles"
|
|
|
|
if [ ! -d ~/.vim/bundle/vundle/ ]
|
|
|
|
then
|
|
|
|
echo "Installing vundle"
|
|
|
|
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
|
|
|
|
fi
|
2014-07-08 00:41:20 -04:00
|
|
|
vim +BundleClean +BundleInstall +qa
|
2014-06-16 23:13:57 -04:00
|
|
|
fi
|
|
|
|
if [ "$VALUE" = "s" ] ; then
|
2014-07-07 04:36:19 -04:00
|
|
|
if [ "$(uname)" != "Darwin" ]; then
|
|
|
|
echo "Installing server applications:"
|
2014-09-03 19:43:00 -04:00
|
|
|
echo $(grep -vE "^\s*#" $ABSPATH/scripts/server.txt | tr "\n" " ")
|
|
|
|
sudo apt-get install $(grep -vE "^\s*#" $ABSPATH/scripts/server.txt | tr "\n" " ")
|
2014-07-07 04:36:19 -04:00
|
|
|
else
|
|
|
|
if [ -d "/usr/local/Library/Taps/phinze/homebrew-cask" ] ; then
|
|
|
|
brew tap phinze/cask
|
2014-07-07 18:50:37 -04:00
|
|
|
brew install brew-cask
|
2014-07-07 04:36:19 -04:00
|
|
|
brew cask
|
|
|
|
fi
|
|
|
|
brew cask install textexpander controlplane gimp inkscape adium vlc iterm2 steam
|
|
|
|
fi
|
2014-06-16 23:13:57 -04:00
|
|
|
fi
|
|
|
|
if [ "$VALUE" = "d" ] ; then
|
|
|
|
echo "Installing desktop applications"
|
2014-07-07 03:20:57 -04:00
|
|
|
if [ "$(uname)" != "Darwin" ]; then
|
2014-09-03 19:43:00 -04:00
|
|
|
echo $(grep -vE "^\s*#" $ABSPATH/scripts/server.txt | tr "\n" " ") $(grep -vE "^\s*#" $ABSPATH/scripts/desktop.txt | tr "\n" " ")
|
|
|
|
sudo apt-get install $(grep -vE "^\s*#" $ABSPATH/scripts/server.txt | tr "\n" " ") $(grep -vE "^\s*#" $ABSPATH/scripts/desktop.txt | tr "\n" " ")
|
2014-07-07 03:20:57 -04:00
|
|
|
else
|
2014-08-06 01:13:59 -04:00
|
|
|
brew install autojump ncdu htop vim youtube-dl tree sshfs ircii imagemagick node ffmpeg wget lua libconfig readline meld
|
2014-07-07 03:20:57 -04:00
|
|
|
fi
|
2014-06-16 23:13:57 -04:00
|
|
|
fi
|
|
|
|
if [ "$VALUE" = "t" ] ; then
|
|
|
|
echo "Syncing tmux"
|
2014-06-16 23:33:58 -04:00
|
|
|
rm ~/.tmux.conf
|
2014-09-01 16:17:38 -04:00
|
|
|
ln -s $ABSPATH/tmux/tmux.conf ~/.tmux.conf
|
2014-06-16 23:13:57 -04:00
|
|
|
fi
|
2014-06-16 23:33:58 -04:00
|
|
|
if [ "$VALUE" = "c" ] ; then
|
|
|
|
echo "Syncing config files"
|
2014-08-02 19:54:06 -04:00
|
|
|
if which trash >/dev/null; then
|
2014-09-23 18:10:30 -04:00
|
|
|
trash ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.vimperator/info/sync/quickmarks ~/.bashrc ~/.pylintrc ~/.zshrc ~/.i3/config ~/.i3/sleep.sh ~/.i3/wall.sh ~/.Xmodmap ~/.xsession ~/.oh-my-zsh/themes/af-magic.zsh-theme ~/.screenrc ~/.Xresources
|
2014-08-02 19:54:06 -04:00
|
|
|
else
|
2014-09-23 18:10:30 -04:00
|
|
|
rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.vimperator/info/sync/quickmarks ~/.bashrc ~/.pylintrc ~/.zshrc ~/.i3/config ~/.i3/sleep.sh ~/.i3/wall.sh ~/.Xmodmap ~/.xsession ~/.oh-my-zsh/themes/af-magic.zsh-theme ~/.screenrc ~/.Xresources
|
2014-08-02 19:54:06 -04:00
|
|
|
fi
|
2014-09-01 16:17:38 -04:00
|
|
|
ln -s $ABSPATH/python/pylintrc ~/.pylintrc
|
|
|
|
ln -s $ABSPATH/vim/vimrc ~/.vimrc
|
|
|
|
ln -s $ABSPATH/vimperator/vimperatorrc ~/.vimperatorrc
|
2014-08-19 14:58:19 -04:00
|
|
|
mkdir -p ~/.vimperator/colors
|
2014-09-01 16:17:38 -04:00
|
|
|
ln -s $ABSPATH/vimperator/vimPgray.vimp ~/.vimperator/colors/vimPgray.vimp
|
2014-08-19 14:58:19 -04:00
|
|
|
mkdir -p ~/.vimperator/info/sync/quickmarks
|
2014-09-01 16:17:38 -04:00
|
|
|
ln -s $ABSPATH/vimperator/quickmarks ~/.vimperator/info/sync/quickmarks
|
|
|
|
ln -s $ABSPATH/git/gitconfig ~/.gitconfig
|
|
|
|
ln -s $ABSPATH/shells/bashrc ~/.bashrc
|
2014-08-23 22:31:20 -04:00
|
|
|
if [ ! -f ~/.oh-my-zsh/oh-my-zsh.sh ] ; then
|
2014-08-20 20:02:25 -04:00
|
|
|
curl -L http://install.ohmyz.sh | sh
|
|
|
|
fi
|
2014-09-28 11:45:17 -04:00
|
|
|
if [ ! -d ~/.fzf ] ; then
|
|
|
|
git clone https://github.com/junegunn/fzf.git ~/.fzf
|
|
|
|
fi
|
2014-09-01 16:17:38 -04:00
|
|
|
ln -s $ABSPATH/shells/zshrc ~/.zshrc
|
2014-09-15 09:31:32 -04:00
|
|
|
ln -s $ABSPATH/shells/screenrc ~/.screenrc
|
2014-09-15 15:32:10 -04:00
|
|
|
ln -s $ABSPATH/shells/Xresources ~/.Xresources
|
|
|
|
xrdb -merge ~/.Xresources
|
2014-09-01 16:17:38 -04:00
|
|
|
ln -s $ABSPATH/shells/af-magic.zsh-theme ~/.oh-my-zsh/themes/af-magic.zsh-theme
|
2014-08-11 15:16:00 -04:00
|
|
|
mkdir -p ~/.i3
|
2014-09-01 16:17:38 -04:00
|
|
|
ln -s $ABSPATH/i3/config ~/.i3/config
|
2014-09-12 19:03:40 -04:00
|
|
|
ln -s $ABSPATH/i3/wall.sh ~/.i3/wall.sh
|
2014-09-01 16:17:38 -04:00
|
|
|
ln -s $ABSPATH/i3/sleep.sh ~/.i3/sleep.sh
|
|
|
|
ln -s $ABSPATH/i3/Xmodmap ~/.Xmodmap
|
|
|
|
ln -s $ABSPATH/i3/xsession ~/.xsession
|
2014-06-16 23:13:57 -04:00
|
|
|
fi
|
2014-07-06 23:09:58 -04:00
|
|
|
if [ "$VALUE" = "l" ] ; then
|
|
|
|
echo "Linking standard directories..."
|
|
|
|
mkdir -p ~/Applications
|
|
|
|
ln -s ~/Applications ~/applications
|
|
|
|
ln -s ~/Desktop ~/desktop
|
|
|
|
ln -s ~/Documents ~/documents
|
|
|
|
ln -s ~/Downloads ~/downloads
|
|
|
|
ln -s ~/Music ~/music
|
|
|
|
ln -s ~/Pictures ~/pictures
|
|
|
|
ln -s ~/Videos ~/videos
|
|
|
|
echo "Done"
|
|
|
|
fi
|
2014-07-07 15:43:52 -04:00
|
|
|
if [ "$VALUE" = "w" ] ; then
|
|
|
|
sudo git clone git://github.com/zolrath/wemux.git /usr/local/share/wemux
|
|
|
|
sudo ln -s /usr/local/share/wemux/wemux /usr/local/bin/wemux
|
|
|
|
sudo cp /usr/local/share/wemux/wemux.conf.example /usr/local/etc/wemux.conf
|
|
|
|
sudo vi `which wemux` +"execute \"normal gg/tmux\<CR>nnnea -2\<Esc>nea -2\<Esc>ggZZ\""
|
2014-07-17 01:50:43 -04:00
|
|
|
sudo vi /usr/local/etc/wemux.conf +":execute \"normal gg/host_list\<CR>nnww\""
|
|
|
|
fi
|
2014-06-13 14:27:12 -04:00
|
|
|
done
|
|
|
|
echo "Done syncing"
|