-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·321 lines (245 loc) · 10.8 KB
/
install.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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#!/usr/bin/env bash
set -e
###############################################################################
# global #
###############################################################################
###################
# documentation #
###################
# Update mirrorlist with the fastest mirrors
# sudo pacman-mirrors --fasttrack
# Limit to 5 mirrors
# An optional number can be supplied to limit the number of mirrors
# in the mirrorlist
# sudo pacman-mirrors --fasttrack 5
# Mirrors for your country only
# Not all countries have mirrors, if geoip returns a country not
# in the pool all mirrors will be used.
# sudo pacman-mirrors --geoip
# Mirrors for Canada and United States
# sudo pacman-mirrors --country United_States,Canada
# Always run after pacman-mirrors
# sudo pacman -Syyu
###############
# variables #
###############
DIR_DEVEL="${HOME}/devel/"
DIR_PERSONAL="${DIR_DEVEL}/personal"
DIR_REPOS="${DIR_DEVEL}/repos"
DIR_REPOS_DEV="${DIR_REPOS}/dev"
DIR_REPOS_TOOLS="${DIR_REPOS}/tools"
DIR_REPOS_EMBEDDED="${DIR_REPOS}/embedded"
DIR_REPOS_UI="${DIR_REPOS}/ui"
DIR_DOTFILES="${HOME}/.dotfiles"
URL_ARM_32_TOOLCHAIN_11_2="https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz"
URL_ARM_64_TOOLCHAIN_11_2="https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz"
DIR_TOOLCHAINS="${HOME}/.toolchains"
DIR_ARM_32_TOOLCHAIN="${DIR_TOOLCHAINS}/11.2/aarch32"
DIR_ARM_64_TOOLCHAIN="${DIR_TOOLCHAINS}/11.2/aarch64"
TEMP_GNOME_CONFIG=/tmp/org.gnome.ini.tmp
BACKGROUND_IMAGE="${HOME}/.wallpapers/wallpaper_001.jpg"
SCREENSAVER_IMAGE="${HOME}/.wallpapers/wallpaper_002.jpg"
##################
# repositories #
##################
REPO_DOTFILES="https://github.com/syedelec/.dotfiles.git"
REPO_TILIX="https://github.com/syedelec/tilix.git"
REPO_QOGIR_GTK_THEME="https://github.com/vinceliuice/Qogir-theme"
REPO_QOGIR_ICN_THEME="https://github.com/vinceliuice/Qogir-icon-theme"
############
# pacman #
############
pacman_groups=(
base base-devel dlang-dmd multilib-devel go
)
pacman_utils=(
cpio unzip cmake xclip xsel xterm evtest cairo net-tools pam
xcb-util-image xcb-util-keysyms tk dos2unix gdu cups help2man repo
nmap gnu-netcat lsof detox sshfs lzop aspell-en bind-tools ctags
boost catch2 fmt mbedtls nlohmann-json acpica dtc autoconf-archive
gptfdisk bc git-cliff navi ventoy virt-manager swtpm minisign
qemu-user-static qemu-user-static-binfmt
)
pacman_dev=(
vim neovim python-pynvim
dub ldc meson
python-pip
rustup
)
pacman_tools=(
docker docker-compose docker-buildx openssl wget curl git ripgrep
fd bat fzf rofi stow tree yay lynx firefox cmus cppcheck shellcheck
meld android-tools cargo efitools deluge evince dialog binwalk
jq texlive-core bash-language-server python-lsp-server git-delta
clang jre11-openjdk tree-sitter tree-sitter-cli duf nvme-cli mpd
mattermost-desktop whois arp-scan uncrustify sd wireguard-tools
telegram-desktop tcpdump wireshark-cli speedtest-cli keepassxc
valgrind mplayer mpc fdupes pngquant
)
pacman_customization=(
arc-gtk-theme bash-completion feh neofetch gnome-tweaks
gnome-shell-extension-caffeine
)
pacman_fonts=(
ttf-roboto ttf-roboto-mono ttf-font-awesome ttf-fira-code ttf-fira-sans
ttf-fira-mono ttf-lato ttf-droid cantarell-fonts
terminus-font ttf-terminus-nerd noto-fonts
)
pacman_lib=(
libcurl-compat libev libx11 libxkbcommon-x11 gnu-efi-libs
)
#########
# yay #
#########
yay_tools=(
google-chrome teams teamviewer sublime-text-4 ticktick
)
yay_utils=(
bfs dtrx bitwise zoxide tio libtree zoom standardnotes-desktop
)
yay_customization=(
tela-icon-theme colorpicker
)
###############################################################################
# setup install #
###############################################################################
sudo sed -i 's|^#\(ParallelDownloads.*\)|\1|' /etc/pacman.conf
sudo sed -i 's|^#\(Color.*\)|\1|' /etc/pacman.conf
echo "======= Enable default session as X11 ======="
sudo sed -i 's|^#\(WaylandEnable.*\)|\1|' /etc/gdm/custom.conf
echo "======= Change default shell ======="
sudo chsh -s /bin/bash
###############################################################################
# install #
###############################################################################
yay_args="--needed --noconfirm --cleanmenu=false --diffmenu=false --editmenu=false"
pacman_args="--needed --noconfirm"
echo "======= Update current packages ======="
sudo pacman ${pacman_args} -Syyu
echo "======= Install groups ======="
# for groups we need to install one by one
for group in ${pacman_groups[*]}; do
sudo pacman -S ${pacman_args} ${group}
done
echo "======= Install 'ARCH' packages ======="
sudo pacman -Sy ${pacman_args} \
${pacman_utils[*]} \
${pacman_dev[*]} \
${pacman_tools[*]} \
${pacman_customization[*]} \
${pacman_fonts[*]} \
${pacman_lib[*]}
echo "======= Install 'AUR' packages ======="
yay -Sy ${yay_args} \
${yay_tools[*]} \
${yay_utils[*]} \
${yay_customization[*]}
###############################################################################
# architecture #
###############################################################################
echo "======= Setup 'DIRS' ======="
# ├── devel
# │ ├── personal
# │ └── repos
# │ ├── dev
# │ ├── embedded
# │ ├── tools
# │ └── ui
# └── .toolchains
# └── [version]
# ├── aarch32
# └── aarch64
mkdir -p "${DIR_PERSONAL}"
mkdir -p "${DIR_REPOS_UI}"
mkdir -p "${DIR_REPOS_DEV}"
mkdir -p "${DIR_REPOS_TOOLS}"
mkdir -p "${DIR_REPOS_EMBEDDED}"
mkdir -p "${DIR_ARM_32_TOOLCHAIN}"
mkdir -p "${DIR_ARM_64_TOOLCHAIN}"
###############################################################################
# toolchains #
###############################################################################
echo "======= Install toolchains ======="
if [[ ! -d "${DIR_ARM_32_TOOLCHAIN}" ]]; then
wget -cO- "${URL_ARM_32_TOOLCHAIN_11_2}" | \
tar xf - -J -C "${DIR_ARM_32_TOOLCHAIN}" --strip-components=1
fi
if [[ ! -d "${DIR_ARM_64_TOOLCHAIN}" ]]; then
wget -cO- "${URL_ARM_64_TOOLCHAIN_11_2}" | \
tar xf - -J -C "${DIR_ARM_64_TOOLCHAIN}" --strip-components=1
fi
###############################################################################
# activation #
###############################################################################
echo "======= Install dotfiles ======="
if [[ ! -d "${DIR_DOTFILES}" ]]; then
git clone --recursive "${REPO_DOTFILES}" "${DIR_DOTFILES}" 1>/dev/null
fi
cd "${DIR_DOTFILES}"
find * -maxdepth 0 -type d -exec stow --adopt {} \;
bat cache --build 1>/dev/null
###############################################################################
# gnome theme #
###############################################################################
echo "======= Setup 'GNOME' theme ======="
mkdir -p "${HOME}/.themes"
mkdir -p "${HOME}/.icons"
if [[ ! -d "${DIR_REPOS_UI}/Qogir-theme" ]]; then
git clone --recursive "${REPO_QOGIR_GTK_THEME}" "${DIR_REPOS_UI}/Qogir-theme" 1>/dev/null --depth 1
else
echo "${DIR_REPOS_UI}/Qogir-theme already exists"
fi
cd "${DIR_REPOS_UI}/Qogir-theme"
./install.sh -d "${HOME}/.themes" -t default -c dark -i default --tweaks square
if [[ ! -d "${DIR_REPOS_UI}/Qogir-icon-theme" ]]; then
git clone --recursive "${REPO_QOGIR_ICN_THEME}" "${DIR_REPOS_UI}/Qogir-icon-theme" 1>/dev/null --depth 1
else
echo "${DIR_REPOS_UI}/Qogir-icon-theme already exists"
fi
cd "${DIR_REPOS_UI}/Qogir-icon-theme"
./install.sh -d "${HOME}/.icons" -t default -c dark
###############################################################################
# gnome settings #
###############################################################################
echo "======= Setup 'GNOME' ======="
cp ${DIR_DOTFILES}/.gnome/org.gnome.ini ${TEMP_GNOME_CONFIG}
dconf load /org/gnome/ < ${TEMP_GNOME_CONFIG}
# dynamically set background/screensaver image
gsettings set org.gnome.desktop.background picture-uri file://${BACKGROUND_IMAGE}
gsettings set org.gnome.desktop.background picture-uri-dark file://${BACKGROUND_IMAGE}
gsettings set org.gnome.desktop.screensaver picture-uri file://${SCREENSAVER_IMAGE}
sudo dconf update
rm -f ${TEMP_GNOME_CONFIG}
###############################################################################
# services #
###############################################################################
echo "======= Setup 'SYSTEMD' ======="
sudo systemctl disable bluetooth
sudo systemctl disable cups
sudo systemctl enable docker
grep -q docker /etc/group || sudo groupadd docker
sudo usermod -aG docker ${USER}
###############################################################################
# sysctl #
###############################################################################
echo "======= Setup 'SYSCTL' ======="
echo kernel.dmesg_restrict = 0 | sudo tee -a /etc/sysctl.d/10-local.conf >/dev/null
sudo sysctl --quiet --system
###############################################################################
# build terminal #
###############################################################################
echo "======= Setup 'TERMINAL' ======="
if [[ ! -d "${DIR_REPOS_TOOLS}/tilix" ]]; then
git clone --recursive "${REPO_TILIX}" "${DIR_REPOS_TOOLS}/tilix" 1>/dev/null
else
echo "${DIR_REPOS_TOOLS}/tilix already exists"
fi
cd "${DIR_REPOS_TOOLS}/tilix"
dub build --build=release &> /dev/null
sudo ./install.sh &> /dev/null
dconf load /com/gexperts/Tilix/ < "${DIR_DOTFILES}/tilix/.config/tilix/tilix.conf"
###############################################################################
# neovim config #
###############################################################################
# nvim -c 'PlugInstall --sync' -c '<\CR>' -c 'qa'
echo "======= Installation done ======="