From e67c925593cfc476826ac1a6ee64ad42c291a6ca Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Thu, 17 Jun 2021 21:37:49 +0200 Subject: [PATCH] Begin add ubuntu conf for zsh, fish, nvim --- install.sh | 14 +++++ install_scripts/ubuntu.sh | 115 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100755 install.sh create mode 100755 install_scripts/ubuntu.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..00050a6 --- /dev/null +++ b/install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +OS_NAME=`cat /etc/os-release | grep "^NAME=" | sed 's/NAME=//g'` +OS_NAME=${OS_NAME^^} # UPPERCASE + +case $OS_NAME in + "UBUNTU") + source ./install_scripts/ubuntu.sh + start + ;; + *) + echo "OS not supported" + ;; +esac \ No newline at end of file diff --git a/install_scripts/ubuntu.sh b/install_scripts/ubuntu.sh new file mode 100755 index 0000000..6ac82fc --- /dev/null +++ b/install_scripts/ubuntu.sh @@ -0,0 +1,115 @@ +refresh_repo () { + echo -n "Refreshing repo..." + sudo apt update +} + +install_fish() { + refresh_repo + echo -n "Installing fish..." + sudo apt install fish -y + echo -n "Success" + read -p "Install oh-my-zsh ? (y/n) [n]" ok + case $ok in + [yY]*) + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + echo -n "Success" + ;; + *) + echo -n "No modification" + ;; + esac + read -p "Set to default shell ? (y/n) [n]" ok + case $ok in + [yY]*) + FISH_BIN=`which fish` + chsh -s "$FISH_BIN" "$USER" + echo -n "Success" + ;; + *) + echo -n "No modification" + ;; + esac + read -p "Install agnoster theme ? (y/n) [n]" ok + case $ok in + [yY]*) + fish -c "omf install agnoster" + echo -n "Success" + ;; + *) + echo -n "No modification" + ;; + esac +} + +install_zsh() { + refresh_repo + echo -n "Installing zsh..." + sudo apt install zsh -y + echo -n "Success" + read -p "Install oh-my-zsh ? (y/n) [n]" ok + case $ok in + [yY]*) + curl -L https://get.oh-my.fish | fish + echo -n "Success" + ;; + *) + echo -n "No modification" + ;; + esac + read -p "Set to default shell ? (y/n) [n]" ok + case $ok in + [yY]*) + ZSH_BIN=`which zsh` + chsh -s "$ZSH_BIN" "$USER" + echo -n "Success" + ;; + *) + echo -n "No modification" + ;; + esac +} + +install_neovim () { + sudo add-apt-repository ppa:neovim-ppa/unstable -y + refresh_repo + sudo apt-get install neovim -y + echo -n "Success" + read -p "Install custom config (Warning : Erase old conf) ? (y/n) [n]" ok + case $ok in + [yY]*) + rm -rf ~/.config/nvim + mkdir -p ~/.config/nvim + cp -r ./configs/nvim/* ~/.config/nvim + refresh_repo + sudo apt install ripgrep -y + ;; + *) + echo -n "No modification" + ;; + esac +} + + +start () { + read -p "Select you shell. (0 - current, 1 - fish, 2 - zsh) [0]" shell + case $shell in + "1") + install_fish + ;; + "2") + install_zsh + ;; + *) + echo -n "No modification" + ;; + esac + read -p "Install nvim 0.5 ? (y/n) [n]" ok + case $ok in + [yY]*) + install_neovim + ;; + *) + echo -n "No modification" + ;; + esac +} \ No newline at end of file