2014-09-01 16:17:38 -04:00
|
|
|
ABSPATH=$(cd "$(dirname "$0")/.."; pwd)
|
2015-01-14 22:27:59 -05:00
|
|
|
echo $ABSPATH
|
2014-11-24 18:45:48 -05:00
|
|
|
while getopts ":hbsdpcw" 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"
|
2014-11-24 18:45:48 -05:00
|
|
|
echo " -p Syncs computer with pip applications in pip.txt"
|
2014-06-22 23:14:05 -04:00
|
|
|
echo " -c Syncs other configuration files"
|
2014-10-13 16:55:50 -04:00
|
|
|
echo " -w Installs wemux [requires vim]"
|
2014-06-22 23:14:05 -04:00
|
|
|
fi
|
2014-06-16 23:13:57 -04:00
|
|
|
if [ "$VALUE" = "b" ] ; then
|
2015-01-03 00:34:38 -05:00
|
|
|
trash ~/.vimrc || rm ~/.vimrc
|
2014-11-16 12:42:59 -05:00
|
|
|
ln -s $ABSPATH/vim/vimrc ~/.vimrc
|
|
|
|
vim +"silent! call Initialize()" +q
|
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
|
2014-10-20 17:25:46 -04:00
|
|
|
brew install caskroom/cask/brew-cask
|
2014-07-07 04:36:19 -04:00
|
|
|
brew cask
|
|
|
|
fi
|
2014-10-20 17:25:46 -04:00
|
|
|
brew cask install gimp inkscape adium vlc iterm2 steam adobe-reader spectacle xquartz
|
2014-07-07 04:36:19 -04:00
|
|
|
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-10-20 17:25:46 -04:00
|
|
|
brew install macvim --with-cscope --with-lua --HEAD
|
|
|
|
brew install vim --with-lua
|
|
|
|
brew install ncdu htop 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
|
2014-11-24 18:45:48 -05:00
|
|
|
if [ "$VALUE" = "p" ] ; then
|
|
|
|
echo "Installing pip applications"
|
|
|
|
echo $(grep -vE "^\s*#" $ABSPATH/scripts/pip.txt | tr "\n" " ")
|
|
|
|
sudo pip install $(grep -vE "^\s*#" $ABSPATH/scripts/pip.txt | tr "\n" " ")
|
|
|
|
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
|
2015-01-15 12:42:10 -05:00
|
|
|
trash ~/.gitconfig ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.bashrc ~/.pylintrc ~/.zshrc ~/.tmux.conf ~/.config/liquidpromptrc
|
2014-08-02 19:54:06 -04:00
|
|
|
else
|
2015-01-15 12:42:10 -05:00
|
|
|
rm ~/.gitconfig ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.bashrc ~/.pylintrc ~/.zshrc ~/.tmux.conf ~/.config/liquidpromptrc
|
2014-08-02 19:54:06 -04:00
|
|
|
fi
|
2014-10-26 10:35:33 -04:00
|
|
|
# Install on all systems
|
2014-10-13 16:55:50 -04:00
|
|
|
ln -s $ABSPATH/tmux/tmux.conf ~/.tmux.conf
|
2014-09-01 16:17:38 -04:00
|
|
|
ln -s $ABSPATH/python/pylintrc ~/.pylintrc
|
|
|
|
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
|
|
|
|
ln -s $ABSPATH/git/gitconfig ~/.gitconfig
|
|
|
|
ln -s $ABSPATH/shells/bashrc ~/.bashrc
|
2015-01-10 23:20:42 -05:00
|
|
|
if which git >/dev/null; then
|
|
|
|
if which zsh >/dev/null; then
|
|
|
|
ln -s $ABSPATH/shells/zshrc ~/.zshrc
|
|
|
|
if [ ! -d ~/.antigen ] ; then
|
|
|
|
git clone https://github.com/zsh-users/antigen ~/.antigen
|
|
|
|
fi
|
|
|
|
# Install antigen bundles
|
|
|
|
zsh -c "source ~/.zshrc;exit"
|
|
|
|
fi
|
|
|
|
if [ ! -d ~/.fzf ] ; then
|
|
|
|
git clone https://github.com/stonewareslord/fzf.git ~/.fzf
|
|
|
|
~/.fzf/install -y
|
|
|
|
fi
|
2014-10-13 16:55:50 -04:00
|
|
|
fi
|
2014-12-07 13:52:33 -05:00
|
|
|
mkdir -p ~/.config
|
2015-01-05 12:44:00 -05:00
|
|
|
ln -s $ABSPATH/shells/liquidpromptrc ~/.config/liquidpromptrc
|
2014-10-19 14:06:31 -04:00
|
|
|
if [ "$(uname)" != "Darwin" ]; then
|
2014-10-26 10:35:33 -04:00
|
|
|
if which trash >/dev/null; then
|
2015-02-13 00:27:28 -05:00
|
|
|
trash ~/.i3/config ~/.i3/sleep.sh ~/.i3/wall.sh ~/.i3/screensaver.sh ~/.Xmodmap ~/.xsession ~/.config/synapse/gtkrc ~/.Xresources
|
2014-10-26 10:35:33 -04:00
|
|
|
else
|
2015-02-13 00:27:28 -05:00
|
|
|
rm ~/.i3/config ~/.i3/sleep.sh ~/.i3/wall.sh ~/.i3/screensaver.sh ~/.Xmodmap ~/.xsession ~/.config/synapse/gtkrc ~/.Xresources
|
2014-10-26 10:35:33 -04:00
|
|
|
fi
|
2014-12-07 13:52:33 -05:00
|
|
|
# Don't install these on Mac
|
2015-01-15 12:42:10 -05:00
|
|
|
mkdir -p ~/.i3
|
2014-10-26 10:35:33 -04:00
|
|
|
ln -s $ABSPATH/i3/config ~/.i3/config
|
|
|
|
ln -s $ABSPATH/i3/sleep.sh ~/.i3/sleep.sh
|
2015-01-15 12:42:10 -05:00
|
|
|
ln -s $ABSPATH/i3/wall.sh ~/.i3/wall.sh
|
2015-02-13 00:27:28 -05:00
|
|
|
ln -s $ABSPATH/i3/i3status.conf ~/.i3/i3status.conf 2>/dev/null
|
2015-01-16 11:11:49 -05:00
|
|
|
ln -s $ABSPATH/i3/screensaver.sh ~/.i3/screensaver.sh
|
2014-10-26 10:35:33 -04:00
|
|
|
ln -s $ABSPATH/i3/Xmodmap ~/.Xmodmap
|
|
|
|
ln -s $ABSPATH/i3/xsession ~/.xsession
|
2014-12-07 13:52:33 -05:00
|
|
|
mkdir -p ~/.config/synapse
|
|
|
|
ln -s $ABSPATH/i3/gtkrc ~/.config/synapse/gtkrc
|
2015-01-15 12:42:10 -05:00
|
|
|
ln -s $ABSPATH/shells/Xresources ~/.Xresources
|
|
|
|
xrdb -merge ~/.Xresources
|
2014-10-19 14:06:31 -04:00
|
|
|
fi
|
2014-06-16 23:13:57 -04:00
|
|
|
fi
|
2014-07-07 15:43:52 -04:00
|
|
|
if [ "$VALUE" = "w" ] ; then
|
2014-10-13 16:55:50 -04:00
|
|
|
echo "Installing wemux..."
|
2014-07-07 15:43:52 -04:00
|
|
|
sudo git clone git://github.com/zolrath/wemux.git /usr/local/share/wemux
|
2014-10-13 16:55:50 -04:00
|
|
|
sudo rm -r /usr/local/bin/wemux
|
|
|
|
sudo rm -r /usr/local/etc/wemux.conf
|
2014-07-07 15:43:52 -04:00
|
|
|
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
|
2014-10-13 16:55:50 -04:00
|
|
|
sudo vim `which wemux` +"execute \"normal gg/tmux\<CR>nnnea -2\<Esc>nea -2\<Esc>ggZZ\""
|
|
|
|
sudo vim /usr/local/etc/wemux.conf +":execute \"normal gg/host_list\<CR>nnww\""
|
2014-07-17 01:50:43 -04:00
|
|
|
fi
|
2014-06-13 14:27:12 -04:00
|
|
|
done
|
|
|
|
echo "Done syncing"
|