forked from okaufmann/dotfiles-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installscript
executable file
·173 lines (134 loc) · 4.3 KB
/
installscript
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/usr/bin/env bash
# Check if the script is running in Bash
if [ -z "$BASH_VERSION" ]; then
echo "Error: This script must be run in Bash, not sh or any other shell." >&2
exit 1
fi
# Hide "last login" line when starting a new terminal session
touch $HOME/.hushlogin
echo 'Install zsh'
echo '------------'
sudo apt-get install -y zsh
# Install zsh
echo 'Install oh-my-zsh'
echo '-----------------'
curl -L https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
# Check if the current shell is not zsh
if [ "$SHELL" != "$(which zsh)" ]; then
# Prompt the user for confirmation
read -p "Do you want to set zsh as your default shell? (y/n) " answer
# Check if the user's answer is 'y' or 'Y'
if [[ "$answer" =~ ^[Yy]$ ]]; then
# Change the default shell to zsh
chsh -s $(which zsh)
fi
fi
echo 'Install zsh theme'
echo '------------'
ln -s $HOME/.dotfiles/zshrc/cobalt2.zsh-theme $HOME/.oh-my-zsh/custom/themes/cobalt2.zsh-theme
echo 'Installing zsh plugins'
echo '------------'
git clone https://github.com/jessarcher/zsh-artisan.git $HOME/.oh-my-zsh/custom/plugins/artisan
git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions
echo 'Create symlinks'
echo '------------'
# Add global gitignore and setup editor
rm $HOME/.global-gitignore
ln -s $HOME/.dotfiles/shell/.global-gitignore $HOME/.global-gitignore
git config --global core.excludesfile "$HOME/.global-gitignore"
git config --global include.path "$HOME/.dotfiles/config/.gitconfig"
git config --global core.editor "vim"
# Symlink zsh prefs
rm $HOME/.zshrc
ln -s $HOME/.dotfiles/shell/.zshrc $HOME/.zshrc
# Symlink vim prefs
rm $HOME/.vimrc
ln -s $HOME/.dotfiles/shell/.vimrc $HOME/.vimrc
rm $HOME/.vim
ln -s $HOME/.dotfiles/shell/.vim $HOME/.vim
# install Vundle for vim Plugins
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/plugin/Vundle.vim
mkdir -p ~/.vim-swp
vim +PluginInstall +qall
# Screen config
rm $HOME/.screenrc
ln -s $HOME/.dotfiles/shell/.screenrc $HOME/.screenrc
echo 'update apt chache and find linux distro'
echo '------------'
sudo apt-get update
linuxDistr=$(awk -F= '/^ID=/{print $2}' /etc/os-release)
echo 'Install zsh-autosuggestions'
echo '------------'
sudo apt-get install -y zsh-autosuggestions
echo 'Install wget'
echo '------------'
sudo apt-get install -y wget
echo 'Install httpie'
echo '--------------'
sudo apt-get install -y httpie
echo 'Install ncdu'
echo '------------'
sudo apt-get install -y ncdu
echo 'Install ack'
echo '-----------'
sudo apt-get install -y ack
echo 'Install tldr'
echo '-----------'
sudo apt-get install -y tldr
echo 'Install vim'
echo '-----------'
sudo apt-get install -y vim
echo 'Install nmap'
echo '-----------'
sudo apt-get install -y nmap
echo 'Install dig'
echo '-----------'
sudo apt-get install -y dnsutils
echo 'Install netstat'
echo '-----------'
sudo apt-get install -y net-tools
echo 'Install screen'
echo '-----------'
sudo apt-get install -y screen
echo 'Install bat'
echo '-----------'
sudo apt-get install -y bat
echo 'Install tree'
echo '-----------'
sudo apt-get install -y tree
echo 'Install prettyping'
echo '---------------------------'
if [ "$linuxDistr" == "debian" ] || [ "$linuxDistr" == "ubuntu" ]; then
sudo apt-get install prettyping -y
else
curl -O https://raw.githubusercontent.com/denilsonsa/prettyping/master/prettyping
chmod +x prettyping
sudo mv prettyping /usr/bin/prettyping
fi
echo 'Install fzf'
echo '-----------'
if [ "$linuxDistr" == "debian" ] || [ "$linuxDistr" == "rasbian" ]; then
sudo apt-get install fzf
else
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
yes | ~/.fzf/install
fi
echo 'Are you using iTerm?'
echo '------------------'
echo 'If you confirm, the terminal integration will be installed. Do you wanna? (y/n) '
read -p 'Answer: ' reply
if [[ $reply =~ ^[Yy]$ ]]
then
curl -L https://iterm2.com/shell_integration/zsh \
-o ~/.iterm2_shell_integration.zsh
echo 'Fix hostname for iTerm'
echo '------------------'
source ~/.dotfiles/shell/.functions
fixHostnameForITerm
source ~/.iterm2_shell_integration.zsh
fi
echo '++++++++++++++++++++++++++++++'
echo '++++++++++++++++++++++++++++++'
echo 'All done!'
echo '++++++++++++++++++++++++++++++'
echo '++++++++++++++++++++++++++++++'