2016-07-18 16:55:56 -04:00
|
|
|
ABSPATH=$(\cd "$(dirname "$0")/.."; pwd)
|
2015-01-14 22:27:59 -05:00
|
|
|
echo $ABSPATH
|
2016-07-26 23:06:22 -04:00
|
|
|
while getopts ":shbc" 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"
|
2016-07-26 23:06:22 -04:00
|
|
|
echo " -s Use this if you don't want custom stonewareslord settings (use after -s)"
|
|
|
|
echo " -c Sync configuration files"
|
|
|
|
fi
|
|
|
|
if [ "$VALUE" = "s" ] ; then
|
|
|
|
sed -i'' -e '/email = stonewareslord@gmail.com/d' -e '/user = Austen Adler/d' -e '/\[user\]/d' -e '/signingkey = CCDFE3F1/d' ~/.gitconfig
|
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
|
2014-06-16 23:33:58 -04:00
|
|
|
if [ "$VALUE" = "c" ] ; then
|
2015-03-01 22:20:58 -05:00
|
|
|
if [ "$2" = "-f" ] ; then
|
|
|
|
# Reinstall antigen
|
|
|
|
rm -rf ~/.antigen
|
|
|
|
fi
|
2014-06-16 23:33:58 -04:00
|
|
|
echo "Syncing config files"
|
2015-08-24 17:43:29 -04:00
|
|
|
if command -v trash 2>&1 /dev/null; then
|
2015-04-02 23:32:32 -04:00
|
|
|
trash ~/.gitconfig ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.bashrc ~/.pylintrc ~/.zsh ~/.zshrc ~/.tmux.conf ~/.config/liquidpromptrc
|
2014-08-02 19:54:06 -04:00
|
|
|
else
|
2015-04-02 23:32:32 -04:00
|
|
|
rm ~/.gitconfig ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.bashrc ~/.pylintrc ~/.zsh ~/.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-04-02 23:32:32 -04:00
|
|
|
ln -s $ABSPATH/zsh ~/.zsh
|
2015-08-24 17:43:29 -04:00
|
|
|
if command -v git 2>&1 >/dev/null; then
|
|
|
|
if command -v zsh 2>&1 >/dev/null; then
|
2015-01-10 23:20:42 -05:00
|
|
|
ln -s $ABSPATH/shells/zshrc ~/.zshrc
|
2016-07-18 16:55:56 -04:00
|
|
|
for i in lpr oh-my-git-themes omg zsh-syntax-highlighting; do
|
|
|
|
if [ ! -d ~/.zsh-git/$i ]; then
|
|
|
|
git clone https://austenwares.com/gogs/stonewareslord/$i.git ~/.zsh-git/$i
|
|
|
|
else
|
|
|
|
\cd ~/.zsh-git/$i
|
|
|
|
git pull
|
|
|
|
\cd -
|
|
|
|
fi
|
|
|
|
done
|
2015-01-10 23:20:42 -05:00
|
|
|
fi
|
|
|
|
if [ ! -d ~/.fzf ] ; then
|
2016-05-22 01:06:48 -04:00
|
|
|
git clone https://austenwares.com/gogs/stonewareslord/fzf.git ~/.fzf
|
2016-07-18 16:55:56 -04:00
|
|
|
~/.fzf/install -y
|
2015-01-10 23:20:42 -05:00
|
|
|
fi
|
2015-08-24 17:43:29 -04:00
|
|
|
else
|
|
|
|
echo "No git! Not installing fzf or antigen"
|
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
|
2015-08-24 17:43:29 -04:00
|
|
|
if command -v trash 2>&1 >/dev/null; then
|
2016-03-19 23:00:40 -04:00
|
|
|
trash ~/.i3/{config,i3status.conf,run.sh} ~/.Xmodmap ~/.xsession ~/.config/synapse/gtkrc ~/.Xresources
|
2014-10-26 10:35:33 -04:00
|
|
|
else
|
2016-03-19 23:00:40 -04:00
|
|
|
rm ~/.i3/{config,i3status.conf,run.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
|
2016-03-19 23:00:40 -04:00
|
|
|
ln -s $ABSPATH/i3/$(hostname)-status.conf ~/.i3/i3status.conf 2>/dev/null
|
2015-03-03 11:29:54 -05:00
|
|
|
ln -s $ABSPATH/i3/run.sh ~/.i3/run.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
|
2016-07-26 23:06:22 -04:00
|
|
|
if command -v xrdb 2>&1 >/dev/null; then
|
|
|
|
xrdb ~/.Xresources
|
|
|
|
fi
|
2014-10-19 14:06:31 -04:00
|
|
|
fi
|
2014-06-16 23:13:57 -04:00
|
|
|
fi
|
2014-06-13 14:27:12 -04:00
|
|
|
done
|
|
|
|
echo "Done syncing"
|