-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
180 lines (157 loc) · 4.28 KB
/
Copy pathinstall.sh
File metadata and controls
180 lines (157 loc) · 4.28 KB
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
174
175
176
177
178
179
180
#!/bin/bash
# use: sudo bash install.sh
# colors
RED='\033[33;31m'
GREEN='\033[33;32m'
YELLOW='\033[33;33m'
BLUE='\033[33;34m'
DEFAULT='\033[33;0m'
################################################################################
# helper methods
#
install_link_deb_bin() {
if command -v "$3" >/dev/null 2>&1; then
echo -e "| --- $3 ${YELLOW}already installed!${DEFAULT}"
else
echo -e "| --- $2 downloading and installing."
wget $1 -O $2 -q --show-progress
dpkg -i "$2" > /dev/null 2>&1
rm "$2"
fi
}
install_apt_get() {
echo -e -n "| --- $1 "
apt-get install -y "$1" > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e "installed ${GREEN}succesfuly.${DEFAULT}"
else
echo -e "${RED}failed.${DEFAULT}"
fi
}
install_atom_apm() {
echo -e -n "| --- [atom-plugin] $1 "
apm install "$1" > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e "installed ${GREEN}succesfuly.${DEFAULT}"
else
echo -e "${RED}failed.${DEFAULT}"
fi
}
update() {
echo -n -e "| --- ${BLUE}update"
apt-get update >/dev/nul
echo -e ", upgrade${DEFAULT}"
apt-get -y upgrade >/dev/null
}
clean() {
echo -e -n "| --- ${BLUE}autoclean"
apt-get -y autoclean >/dev/null
echo -e -n ", autoremove"
apt-get -y autoremove >/dev/null
echo -e ", -f install${DEFAULT}"
apt-get -f install >/dev/null
}
################################################################################
# install
#
install_atom() {
atom_link="https://atom.io/download/deb"
atom_app="atom-amd64.deb"
atom_bin="atom"
install_link_deb_bin $atom_link $atom_app $atom_bin
chown -R "$(whoami)" ~/.atom
install_atom_packages
}
install_chrome() {
chrome_link="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
chrome_app="google-chrome-stable_current_amd64.deb"
chrome_bin="google-chrome"
install_link_deb_bin $chrome_link $chrome_app $chrome_bin
}
install_apps() {
# shell
install_apt_get "zsh" # shell
install_apt_get "terminator" # terminal
install_apt_get "tmux" # terminal application
# texteditor
install_apt_get "vim" # terminal editor
install_apt_get "shellcheck" # linter shellscript
install_apt_get "ack-grep" # grepping tool command line
# ssh
install_apt_get "openssh-client" # ssh
install_apt_get "openssh-server" # ssh
# nodejs
install_apt_get "nodejs" # programming language
install_apt_get "nodejs-legacy" # allows the use of node
install_apt_get "npm" # node packages
# python
install_apt_get "python-pip" # python packages
# applications
install_apt_get "git" # repository
install_apt_get "gimp" # photo editor
install_apt_get "gpodder" # podcast
install_apt_get "shutter" # screen sniping tool
install_apt_get "meld" # file / folder diff comparison
}
install_atom_packages() {
install_atom_apm "linter"
install_atom_apm "linter-shellcheck"
install_atom_apm "linter-clang"
install_atom_apm "autocomplete-clang"
install_atom_apm "language-csharp"
install_atom_apm "highlight-selected"
install_atom_apm "jsonlint"
install_atom_apm "atom-beautify"
install_atom_apm "file-icons"
}
install_npm_packages() {
echo "| -- [npm] wic"
npm install -g express-generator
}
install_csharp() {
# INSTRUCTIONS: http://www.mono-project.com/docs/getting-started/install/linux/#usage
# TEST: http://www.mono-project.com/docs/getting-started/mono-basics/
install_apt_get "mono-devel"
install_apt_get "mono-complete"
install_apt_get "ca-certificates-mono"
install_apt_get "mono-xsp4"
install_apt_get "gtk2.0"
# formatter
install_apt_get "uncrustify"
}
install_cpp() {
# TODO: clang-format requires a cfg
# formatter
install_apt_get "clang" # required for linter and autocomplete
install_apt_get "clang-format" # formatter
}
install_java() {
install_apt_get "ant"
install_apt_get "default-jdk"
}
install_latex() {
# TODO: install it :-)
echo "| -- [latex] wic"
}
################################################################################
# install.sh
# TODO: make zsh default shell
# NOTE: use pip for python packages
# NOTE: use apm for atom packages
main() {
if [ "$(id -u)" != "0" ]; then
echo -e "${DEFAULT}| --- sudo is ${RED}required.${DEFAULT}"
exit 1
fi
clear
update
install_apps
install_chrome
install_atom
install_csharp
install_cpp
install_latex
install_npm_packages
clean
}
main