unixconf/unixconf.sh

40 lines
933 B
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"
for musthave in $musthaves; do
which "$musthave" >/dev/null 2>&1
if [ "$?" -ne 0 ]; then
echo "You should install ${musthave}."
echo "On Debian: apt-get install zsh wget git vim openssh-client rxvt-unicode unzip ruby"
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/.bashrc"
# 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
vim +PluginInstall +qall