#! /bin/sh
#
# clone_and_link.sh
# Copyright (C) 2016 fabian <fabian@fabi-laptop-arch>
#
# Distributed under terms of the MIT license.
#

sudo pacman --needed -Sy archlinux-keyring --noconfirm
sudo pacman --needed -Syu --noconfirm
sudo pacman --needed -Sy base-devel xorg xorg-xinit gnome gnome-extra neovim zsh tmux openssh alacritty powerline-fonts python-pip --noconfirm
cp $PWD/nvim/scheme.vim.template $PWD/nvim/scheme.vim
cp $PWD/.config/alacritty/schemes.yml.template $PWD/.config/alacritty/schemes.yml
pip3 install neovim
./clone_and_link.sh
./copy_fonts_arch.sh
if [ $SHELL != "/bin/zsh" ]; then
    chsh -s /usr/bin/zsh;
fi

for filename in zsh/.*_arch.example; do
    cp $filename ${filename:0:-13}
done

for filename in tmux/.*_arch.example; do
    cp $filename ${filename:0:-13}
done

for filename in vim/.*_arch.example; do
    cp $filename ${filename:0:-13}
done
echo "You should now start tmux (and zsh) and nvim  for automatic plugin installation."
