unixconf/unixconf.sh

52 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
gitlink="https://gitlab.cpy.re/florian/unixconf/repository/archive.zip?ref=master"
musthaves="zsh wget git vim ssh-agent urxvt unzip ruby ctags"
for musthave in $musthaves; do
which "$musthave" >/dev/null 2>&1
if [ "$?" -ne 0 ]; then
echo "You should install ${musthave}."
echo "On Ubuntu 14.04: apt-get install zsh wget git vim-nox openssh-client rxvt-unicode unzip ruby exuberant-ctags"
exit
fi
done
# ZSH setup
SHELL=zsh sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
echo "Setting ZSH as default."
echo "exec zsh" >> "$HOME/.bash_profile"
# Copy configurations
tempdir="temp_$(date -I)"
cd "$HOME" || exit
mkdir "$tempdir"
cd "$tempdir" || exit
wget -O tempconf.zip "$gitlink"
unzip tempconf.zip
rm tempconf.zip
rootdir="$(ls)"
cd "$rootdir/configurations" || exit
cp .* "$HOME/"
# Vim setup
if (! test -d "$HOME/.vim" ); then
mkdir "$HOME/.vim"
fi
if (! test -d "$HOME/.vim/bundle" ); then
mkdir "$HOME/.vim/bundle"
fi
if (! test -d "$HOME/.vim/spell" ); then
mkdir "$HOME/.vim/spell"
fi
cd "$HOME/.vim/spell" || exit
wget http://ftp.vim.org/vim/runtime/spell/fr.utf-8.spl
git clone https://github.com/VundleVim/Vundle.vim.git "$HOME/.vim/bundle/vundle"
vim +PluginInstall +qall
cd "$HOME" || exit
rm -r "$tempdir"