diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ad1cc6b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM debian:jessie + +COPY ./ /srv + +VOLUME /srv \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fb4a90d --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +DOCKER_COMPOSE = docker-compose + +EXEC_DEBIAN = $(DOCKER_COMPOSE) exec -T debian /entrypoint + +start: + printf "\033[32m You can go take a coffee while we work for you \033[0m\n" + $(DOCKER_COMPOSE) pull + $(DOCKER_COMPOSE) up -d --remove-orphans debian + +stop: + $(DOCKER_COMPOSE) stop + +run: + $(EXEC_DEBIAN) ./install_zsh.sh + +connect: ## Connect to the container of the project + $(EXEC_DEBIAN) + +.PHONY: start stop run connect diff --git a/README.md b/README.md index f21893a..cb109f1 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -# zsh_powerlevel9k_installer +### Custom ZSH and powerlevel9k autoinstaller for debian + +Install software and fonts needed ; customise ~/.zshrc ; etting zsh as default shell + +**Installation :** + +Just run ./install_zsh.sh and enjoy ! \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bb25f18 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3.4' + +services: + debian: + image: debian:jessie + volumes: + - ./:/srv:ro \ No newline at end of file diff --git a/install_zsh.sh b/install_zsh.sh index 29d988c..dfab2d8 100755 --- a/install_zsh.sh +++ b/install_zsh.sh @@ -1,4 +1,9 @@ #!/bin/bash +# Install script for ZSH and Powerlevel9k + +set -e +set -u + if which tput >/dev/null 2>&1; then ncolors=$(tput colors) fi @@ -18,17 +23,17 @@ else NORMAL="" fi -set -e - command -v git >/dev/null 2>&1 || { - echo "Error: git is not installed" + echo "${RED}Error: git is not installed${NORMAL}" exit 1 } -apt-get install git zsh fonts-powerline wget curl tee +command -v tee >/dev/null 2>&1 || { + echo "${RED}Error: tee is not installed${NORMAL}" + exit 1 +} -printf "${BLUE}Installing Oh My Zsh...${NORMAL}\n" -sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +apt-get install -y git zsh fonts-powerline wget curl printf "${BLUE}Installing nerd-fonts...${NORMAL}\n" wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.0.0/Hack.zip @@ -40,17 +45,17 @@ fc-cache -f -v printf "${BLUE}Cloning powerlevel9k...${NORMAL}\n" env git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k || { - printf "Error: git clone of powerlevel9k repo failed\n" + printf "${RED}Error: git clone of powerlevel9k repo failed${NORMAL}\n" exit 1 } printf "${BLUE}Cloning zsh-autosuggestions...${NORMAL}\n" env git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions || { - printf "Error: git clone of zsh-autosuggestions repo failed\n" + printf "${RED}Error: git clone of zsh-autosuggestions repo failed${NORMAL}\n" exit 1 } printf "${BLUE}Cloning zsh-syntax-highlighting...${NORMAL}\n" env git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting || { - printf "Error: git clone of zsh-syntax-highlighting repo failed\n" + printf "${RED}Error: git clone of zsh-syntax-highlighting repo failed\${NORMAL}n" exit 1 } @@ -184,8 +189,11 @@ source $ZSH/oh-my-zsh.sh # alias ohmyzsh="mate ~/.oh-my-zsh" END +printf "${BLUE}Installing Oh My Zsh...${NORMAL}\n" +sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" + printf "${BLUE}Sourcing ~/.zshrc${NORMAL}\n" /bin/zsh -c 'source ~/.zshrc' printf "${BLUE}Setting zsh as default shell${NORMAL}\n" -chsh -s /bin/zsh \ No newline at end of file +chsh -s /bin/zsh