-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstarter.sh
executable file
·77 lines (60 loc) · 1.76 KB
/
starter.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
#!/bin/bash
update_and_upgrade() {
apt-get update -y
apt-get upgrade -y
apt-get autoremove -y
apt-get autoclean -y
}
create_default_aliases() {
if [ `alias | grep dlb | wc -l` > 0 ]; then
# Delete all local branches except master
[ -f ~/.zshrc ] && echo "alias dlb=\"git branch | grep -v 'master' | xargs git branch -D\"" >> ~/.zshrc
fi
}
package_exists() {
dpkg -s "$1" >/dev/null 2>&1
}
# Upgrading system before anything
echo ">>> Upating system..."
update_and_upgrade
echo ">>> Looking for new packages..."
# Installing basic requirements
for pkg in `cat packages/packages.apt`; do
if package_exists $pkg; then
echo "$pkg is already installed."
else
apt-get install $pkg -y
fi
done
# SSH Setup
if [ ! -f ~/.ssh/id_rsa.pub ]; then
echo ">>> Creating SSH Keys"
ssh-keygen
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa
fi
# OhMyZsh
if [ ! -f ~/.zshrc ]; then
echo ">>> Installing OhMyZsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
# Aliases
create_default_aliases
# Google Chrome
# Only base64
if package_exists google-chrome-stable; then
echo "Google Chrome is already installed."
else
echo ">>> Installing Google Chrome"
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
apt-get update
apt-get install google-chrome-stable -y
fi
## Style and Themes
# Terminator Dracula Theme
if package_exists terminator; then
mkdir ~/.config/terminator
touch ~/.config/terminator/config
echo "$(cat static/dracula-theme-terminator)" > ~/.config/terminator/config
fi