-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.sh
executable file
·89 lines (82 loc) · 3.2 KB
/
installer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
# -[ FCT IS_INSTALLED ]-----------------------------------------------------------------------------
# check if a cmd is installed
is_installed(){ command -v "${1}" > /dev/null 2>&1 ; }
# -[ UPDATE ]---------------------------------------------------------------------------------------
cd ~
if is_installed "yes";then
echo "coreutils already installed"
else
yes | sudo apt install coreutils
fi
sudo apt update
yes | sudo apt upgrade
# -[ LISTE DES PAQUETS A INSTALLER ]----------------------------------------------------------------
PACK_LIST=("curl" "git" "zsh" "python3" "vim" "vim-gtk3" "clang-12" "gdb" "valgrind" "make" "tree" "libbsd-dev" "php")
for pkg in ${PACK_LIST[@]};do
echo -e "\t- Install package ${pkg}"
if is_installed "${pkg}";then
echo "Already installed"
else
yes | sudo apt install ${pkg}
fi
done
# -[ CC ]-------------------------------------------------------------------------------------------
echo -e "\t- Config clang:"
if is_installed "cc";then
echo "CC already configured"
else
sudo update--alternatives --install /usr/bin/cc cc /usr/bin/clang-12 100
fi
# -[ VIM ]------------------------------------------------------------------------------------------
echo -e "\t- Config VIM"
if [[ -d ~/.vim ]];then
echo "~/.vim/ folder already exist, we gonna make an Archive at ~/vim_arch_<date> then install
my personnal configuration"
mv ~/.vim ~/vim_arch_$(date +%Y%m%d)
fi
git clone [email protected]:alterGNU/.vim.git ~/.vim && vim -c PlugInstall -c qa
# -[ GOOGLE-CHROME ]--------------------------------------------------------------------------------
echo -e "\t- Install Google-Chrome"
if is_installed "google-chrome";then
echo "Already installed"
else
cd ~/Downloads
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt install -f
cd ~
fi
# -[ GIT ]------------------------------------------------------------------------------------------
echo -e "\t- Config GIT"
if [[ -f ~/.gitconfig ]];then
echo "Git Already Configured"
else
git config --global user.name "alterGNU"
git config --global user.email "[email protected]"
git config --global core.editor "vim"
git config --global mergetool vimdiff
git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config --global alias.dt difftool
fi
# -[ NORMINETTE ]-----------------------------------------------------------------------------------
echo -e "\t- Config Norminette"
if is_installed "norminette";then
echo "Git Already Configured"
else
yes | sudo apt install python3-setuptools
yes | sudo apt install pipx
pipx install norminette
pipx ensurepath
fi
# -[ OH-MY-ZSH ]------------------------------------------------------------------------------------
echo -e "\t- Config ZSH"
if [[ -f ~/.zshrc ]];then
echo "ZSH Already configured"
else
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
chsh -s $(which zsh)
echo "alias ccw=\"cc -Wall -Wextra -Werror -lbsd\"" >> ~/.zshrc
echo "export PATH=/home/altergnu/.local/funcheck/host:$PATH" >> ~/.zshrc
fi