#!/bin/bash
#TO USE THIS SCRIPT : PASTE THE FOLLOWING LINE IN THE TERMINAL
#sh -c "$(wget https://ech1.netlify.com/Conf/configure.sh -O -)"
#wget https://blog.void.yt/Conf/configure.sh ; chmod +x configure.sh ; ./configure.sh
cd ~

GREEN="\033[0;32m"
RED="\033[0;31m"
ORANGE="\033[0;33m"
NC="\033[0m"

echo -en "${GREEN}[+]${NC} TERMINAL CONFIGURATION SCRIPT \n"

pwd

if ! command -v pacman &> /dev/null
then
	echo -en "not arch, assuming we're on debian, using $(which apt)"
	echo -en "${GREEN}[+]${NC} Arch Linux not found, defaulting to Debian\n"
	echo -en "${GREEN}[+]${NC} Using $(which apt)\n"
	sudo apt install zsh tmux git vim -y
else
	echo -en "${GREEN}[+]${NC} Arch Linux detected\n"
	echo -en "${GREEN}[+]${NC} Using $(Which pacman)\n"
	sudo pacman -Syy zsh tmux git vim alacritty --noconfirm
fi

sudo chsh -s /bin/zsh
cd ~

#echo -en "${GREEN}[+]${NC} "


cd ~
echo -en "${GREEN}[+]${NC}  ~/.tmux.git\n"
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .

echo -en "${GREEN}[+]${NC}  ~/.tmux.conf.local\n"
wget https://blog.void.yt/Conf/tmux.conf.local -O ~/.tmux.conf.local

#echo '[+] CONFIGURE.SH IS NOT DONE YOU NEED TO TYPE EXIT!'
wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh ; chmod +x install.sh ; sed -i "s/exec zsh.*/#dontexeczsh/gi" install.sh ; ./install.sh

rm install.sh


echo -en "${GREEN}[+]${NC} ~/.ohmyzsh/custom/plugins/zsh-autosuggestions\n"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
echo -en "${GREEN}[+]${NC} ~/.ohmyzsh/custom/plugins/zsh-autocomplete\n"
git clone https://github.com/marlonrichert/zsh-autocomplete ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autocomplete
echo -en "${GREEN}[+]${NC} ~/.ohmyzsh/custom/plugins/zsh-syntax-highlighting\n"
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting


echo -en "${GREEN}[+]${NC} lambda-mod.zsh-theme\n"
wget https://blog.void.yt/Conf/lambda-mod.zsh-theme -O ~/.oh-my-zsh/themes/lambda-mod.zsh-theme

mkdir -p ~/.config/alacritty
echo -en "${GREEN}[+]${NC} ~/.config/alacritty/alacritty.yml\n"
wget https://blog.void.yt/Conf/alacritty.yml -O ~/.config/alacritty/alacritty.yml
echo -en "${GREEN}[+]${NC} ~/.zshrc \n"
wget https://blog.void.yt/Conf/zshrc -O ~/.zshrc
echo -en "${GREEN}[+]${NC} ~/.vimrc \n"
wget https://blog.void.yt/Conf/vimrc -O ~/.vimrc

mkdir ~/.ssh/

#if ! command -v pacman &> /dev/null
#then
#	echo -en "${GREEN}[+]${NC} Alacritty\n"
#	#echo -en "${GREEN}[+]${NC} To install alacritty goto ${GREEN}https://github.com/alacritty/alacritty/releases/\n"
#	#echo -en "${GREEN}[+]${NC} cd ~/Downloads\n"
#	#echo -en "${GREEN}[+]${NC} sudo dpkg -i alacritty.deb\n"
#	sudo apt-get install cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev python3 -y
#	cd /tmp 
#	git clone https://github.com/alacritty/alacritty.git
#	cd alacritty
#	curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
#	source $HOME/.cargo/env
#	rustup override set stable
#	rustup update stable
#	cargo build --release
#	sudo cp target/release/alacritty /usr/bin/alacritty
#	mkdir ~/.ssh
#else
#	exit
#fi

cd ~
