-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·485 lines (431 loc) · 12.9 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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
#!/bin/bash
set -eo pipefail # strict mode
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
info () {
printf "${RED}${BOLD}*** $1 ${NORMAL}\n"
}
info_done () {
printf "${RED}${BOLD}*** Done! ${NORMAL}\n\n"
sleep 1
}
info_error () {
printf "${BLUE}${BOLD}!!!ERROR: $1 ${NORMAL}\n"
exit 1
}
info_important () {
printf "${BLUE}${BOLD}!!! $1 ${NORMAL}\n"
}
info_ascii () {
printf "${GREEN}${BOLD}
_ _ _ __ _ _
(_) (_) | / /| | | |
__ _ _ __ ___ ___| | __ / /_| | ___ | |_ ___
/ _' | '__| \ \ / / | |/ / / / _' |/ _ \| __/ __|
| (_| | | | |\ V /| | < / / (_| | (_) | |_\__ \
\__,_|_| | | \_/ |_|_|\_\/_/ \__,_|\___/ \__|___/
_/ |
|__/
${NORMAL}"
sleep 1
}
reset
info_ascii
if (( $EUID == 0 )); then
info_error "Do not run this script as root"
fi
info "Please enter your password so that this script can sudo:\n*** (hopefully sudo will remember your authentication and not prompt you again)"
sudo -k printf "${BLUE}${BOLD}!!! Successfully elevated priviledges.${NORMAL}\n"
cd ~
info "Updating packages"
sudo apt update
[[ -z "${SKIP_LONG_INSTALLS}" ]] && sudo apt upgrade -y || info_important "Skipping apt upgrade"
info_done
info "Installing git"
sudo apt install -y git
info_done
info "Installing stow"
sudo apt install -y stow
info_done
info "Cloning arjvik/dots"
if ! [[ -d ~/dots/.git ]]; then
rm -rf dots
git clone https://github.com/arjvik/dots
else
info "dots already exists, performing git pull"
cd dots
git pull
cd ../
fi
info_done
info "Installing zsh"
sudo apt install -y zsh
info_done
info "Configuring zsh (antigen, powerlevel10k, etc)"
rm -rf ~/.zsh*
rm -rf ~/.antigen
rm -rf ~/.bash_history
rm -rf ~/.cache/p10k*
cd ~/dots
stow zsh
zsh ~/.zshrc
sudo usermod --shell /usr/bin/zsh $USER
info_important "Installed zsh and extras (antigen, powerlevel10k, etc)"
info_done
info "Installing gnome-calculator (apt, not snap)"
sudo snap remove gnome-calculator
sudo apt install -y gnome-calculator
info_done
info "Installing i3"
cd /opt
if ! type i3; then
sudo git clone --origin i3-gaps https://github.com/Airblader/i3 i3-gaps
sudo chown -R $USER:$USER i3-gaps
cd i3-gaps
info "First, installing dependencies"
sudo apt install -y build-essential meson libxcb1-dev libxcb-keysyms1-dev \
libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev \
libstartup-notification0-dev libxcb-randr0-dev \
libev-dev libxcb-cursor-dev libxcb-xinerama0-dev \
libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev \
autoconf libxcb-xrm0 libxcb-xrm-dev automake libxcb-shape0-dev
rm -rf build/
mkdir -p build && cd build/
meson --prefix /usr --sysconfdir /etc --buildtype release --optimization 3
ninja
sudo ninja install
else
info "i3 found, assuming its i3-gaps"
fi
info_important "Installed i3-gaps"
info_done
info "Removing unneeded xsessions"
[ -e /usr/share/xsessions/i3-with-shmlog.desktop ] &&
sudo mv /usr/share/xsessions/i3-with-shmlog.desktop{,.disabled}
[ -e /usr/share/wayland-sessions/ubuntu-wayland.desktop ] &&
sudo mv /usr/share/wayland-sessions/ubuntu-wayland.desktop{,.disabled}
info_done
info "Installing i3lock-color"
cd /opt
# Ensure that we have the forked version of i3lock (i3lock-color)
if ! type i3lock || ! i3lock -v |& grep --color=none "Cassandra Fox"; then
sudo apt remove -y i3lock
sudo apt install -y libjpeg-turbo8-dev libpam0g-dev libxcb-composite0-dev
sudo git clone https://github.com/Raymo111/i3lock-color
sudo chown -R $USER:$USER i3lock-color
cd i3lock-color
git tag -f "git-`git rev-parse --short HEAD`"
autoreconf --force --install
rm -rf build/
mkdir -p build && cd build/
../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers
make
sudo make install
else
info "i3lock-color found"
fi
info_important "Installed i3lock-color"
info_done
info "Installing and configuring lightdm"
sudo apt install -y slick-greeter lightdm-settings
# Save slick-greeter config
sudo tee /etc/lightdm/slick-greeter.conf >/dev/null <<EOF
[Greeter]
theme-name=Adapta-Nokto
icon-theme-name=Paper
background-color=#000000
background=$HOME/dots/walls/adapta-tealized.jpg
show-a11y=true
show-keyboard=false
draw-grid=true
EOF
info_done
info "Configuring i3"
sudo apt install -y jq xsettingsd maim
rm -rf ~/.config/i3
cd ~/dots
stow i3
info_done
info "Installing feh"
sudo apt install -y feh
info_done
info "Installing compton"
sudo apt install -y compton
info_done
info "Stowing compton"
cd ~/dots
stow compton
info_done
info "Installing polybar"
cd /opt
if ! type polybar; then
sudo git clone --recursive https://github.com/polybar/polybar
sudo chown -R $USER:$USER polybar
cd polybar
info "First, installing dependencies"
sudo apt install -y build-essential git cmake cmake-data \
pkg-config libcairo2-dev libxcb1-dev libxcb-util0-dev \
libxcb-randr0-dev libxcb-composite0-dev \
xcb-proto libxcb-image0-dev libxcb-ewmh-dev libxcb-icccm4-dev \
libxcb-xkb-dev libxcb-xrm-dev libxcb-cursor-dev libasound2-dev \
libpulse-dev libjsoncpp-dev libmpdclient-dev \
libcurl4-openssl-dev libnl-genl-3-dev
sudo apt install -y python3-xcbgen || sudo apt install -y python-xcbgen
./build.sh --all-features -g -A
else
info "polybar found"
fi
info_important "Installed polybar"
info_done
info "Stowing polybar"
rm -rf ~/.config/polybar
rm -rf ~/bin/launch-polybar
cd ~/dots
stow polybar
info_done
if [[ -z "${SKIP_LONG_INSTALLS}" ]]; then
CODENAME="$(lsb_release -c | cut -f2)"
case "$CODENAME" in
bionic)
info "Installing Adapta GTK Theme"
if ! [[ -e /etc/apt/sources.list.d/tista-ubuntu-adapta-$CODENAME.list ]]; then
sudo add-apt-repository -yu ppa:tista/adapta
sudo apt update
else
info "PPA Already added"
fi
sudo apt install -y adapta-gtk-theme adapta-backgrounds
info_done
info "Installing Paper Icon Theme"
if ! [[ -e /etc/apt/sources.list.d/snwh-ubuntu-ppa-$CODENAME.list ]]; then
sudo add-apt-repository -yu ppa:snwh/ppa
sudo apt update
else
info "PPA Already added"
fi
sudo apt install -y paper-icon-theme
info_done
;;
disco)
if ! [[ -e /etc/apt/sources.list.d/tista-ubuntu-adapta-$CODENAME.list ]]; then
info_important "Please install Adapta GTK Theme manually."
info_important "You will likely have to use the Bionic repos for it to work."
info_important ""
info_important "This doesn't have to be done now, you can do it later."
info_important "Press enter to continue"
read -n 1 -s
else
info "Adapta GTK Theme (Bionic 18.04 repos) installed"
fi
info "Installing Paper Icon Theme"
if ! [[ -e /etc/apt/sources.list.d/snwh-ubuntu-ppa-$CODENAME.list ]]; then
sudo add-apt-repository -yu ppa:snwh/ppa
sudo apt update
else
info "PPA Already added"
fi
sudo apt install -y paper-icon-theme
info_done
;;
focal)
info "Installing Adapta GTK Theme"
sudo apt install -y adapta-gtk-theme
info_done
info "Installing Paper Icon Theme"
if ! [[ -e /etc/apt/sources.list.d/tista-ubuntu-adapta-$CODENAME.list ]]; then
info_important "Please install Paper Icon Theme manually."
info_important "You will likely have to use the Disco repos for it to work."
info_important ""
info_important "This doesn't have to be done now, you can do it later."
info_important "Press enter to continue"
read -n 1 -s
else
info "Adapta GTK Theme (Bionic 18.04 repos) installed"
fi
info_done
;;
*)
info "Installing Adapta GTK Theme"
if ! [[ -e /etc/apt/sources.list.d/tista-ubuntu-adapta-$CODENAME.list ]]; then
info_important "Please install Adapta GTK Theme manually."
info_important "You will likely have to use the Bionic repos for it to work."
info_important ""
info_important "This doesn't have to be done now, you can do it later."
info_important "Press enter to continue"
read -n 1 -s
else
info "Adapta GTK Theme (Bionic 18.04 repos) installed"
fi
info_done
info "Installing Paper Icon Theme"
if ! [[ -e /etc/apt/sources.list.d/tista-ubuntu-adapta-$CODENAME.list ]]; then
info_important "Please install Paper Icon Theme manually."
info_important "You will likely have to use the Bionic repos for it to work."
info_important ""
info_important "This doesn't have to be done now, you can do it later."
info_important "Press enter to continue"
read -n 1 -s
else
info "Adapta GTK Theme (Bionic 18.04 repos) installed"
fi
info_done
;;
esac
info "Installing Nerd Fonts (Source Code Pro and Ubuntu Mono)"
cd /tmp
git clone --depth=1 https://github.com/ryanoasis/nerd-fonts
nerd-fonts/install.sh SourceCodePro UbuntuMono
cd ~
info_done
info "Selecting GTK, Icon Theme, and Font"
gsettings set org.gnome.desktop.interface gtk-theme "Adapta-Nokto"
gsettings set org.gnome.desktop.interface icon-theme "Paper"
gsettings set org.gnome.desktop.interface monospace-font-name "SauceCodePro Nerd Font 12"
info_done
info "Installing gnome-tweaks"
sudo apt install -y gnome-tweaks
info_done
else
info_important "Skipping installation of Adapta GTK Theme, Paper Icon Theme, and Nerd Fonts"
fi
info "Configuring Nautilus"
cd ~/dots
stow nautilus
info_done
info "Installing dunst"
sudo apt install -y dunst
info_done
info "Configuring dunst"
[ -e /usr/share/dbus-1/services/org.freedesktop.Notifications.service ] \
&& sudo mv /usr/share/dbus-1/services/org.freedesktop.Notifications.service{,.disabled}
cd ~/dots
stow dunst
info_done
info "Installing xwinwrap"
cd /opt
if ! type xwinwrap; then
sudo apt install -y xorg-dev build-essential libx11-dev x11proto-xext-dev libxrender-dev libxext-dev
sudo git clone https://github.com/ujjwal96/xwinwrap
sudo chown -R $USER:$USER xwinwrap
cd xwinwrap
make
sudo make install
else
info "xwinwrap found"
fi
info_important "Installed xwinwrap"
info_done
info "Installing qutebrowser"
sudo apt install -y qutebrowser libjs-pdf
info_done
info "Stowing qutebrowser"
rm -rf ~/.config/qutebrowser
cd ~/.local/share
rm -f applications/qutebrowser.desktop applications/qutebrowser-incognito.desktop
cd ~/dots
stow qutebrowser
xdg-settings set default-web-browser org.qutebrowser.qutebrowser.desktop
info_done
info "Installing lastpass-cli"
sudo apt install -y lastpass-cli
info_done
info "Installing rofi"
sudo apt install -y rofi
rm -rf ~/.local/share/rofi/
cd ~/dots
stow rofi
## WEIRD WORKAROUND:
git checkout -- rofi/.local/share/rofi/themes/material.rasi
info_done
info "Installing Xorg tools"
sudo apt install -y xclip xsel xdotool
info_done
info "Installing Mopidy and ncmpcpp"
sudo apt install -y ncmpcpp
cd ~
rm -rf .ncmpcpp
cd ~/dots
stow mopidy
sudo apt install -y gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly mpc playerctl
info_done
info "Installing cava"
cd /opt
if ! type cava; then
sudo apt install -y libfftw3-dev libasound2-dev libncursesw5-dev libpulse-dev libtool automake libiniparser-dev
sudo git clone https://github.com/karlstav/cava
sudo chown -R $USER:$USER cava
cd cava
export CPPFLAGS=-I/usr/include/iniparser
./autogen.sh
./configure
make
sudo make install
unset CPPFLAGS
else
info "cava found"
fi
info_important "Installed cava"
info_done
info "Stowing cava"
rm -f ~/bin/launch-cava
rm -rf ~/.config/cava
rm -f ~/.local/share/applications/cava.desktop
cd ~/dots
stow cava
info_done
info "Installing KDE Connect"
sudo apt install -y kdeconnect qt5-style-plugins
info_done
info "Installing Java 8 and 11 JDK"
[[ -z "${SKIP_LONG_INSTALLS}" ]] \
&& sudo apt install -y openjdk-11-jdk openjdk-11-source openjdk-8-jdk openjdk-8-source \
|| info_important "Skipping installing java"
info_done
info "Installing and configuring python"
if ! type pip3; then
info "Installing pip3 (python package manager)"
sudo apt install -y python3-pip
else
info "pip3 found"
fi
if ! type virtualenv; then
info "Installing virtualenv (python sandbox manager)"
sudo apt install -y virtualenv
else
info "virtualenv found"
fi
unset PIP_REQUIRE_VIRTUALENV
pip3 install ptpython pipx
cd ~
rm -f .pystartup
cd ~/dots
stow python
info_done
info "Stowing Octave configuration"
cd ~/dots
stow octave
info_done
info_important "Installation complete! Thank you for using arjvik's dots!"
info_important "Arjun's usual installation checklist after this:"
info_important "[ ] Select LightDM as the default login manager (sudo dpkg-reconfigure lightdm)"
info_important "[ ] Install Adapta and Paper if not already installed"
info_important "[ ] Set up Canonical Livepatch"
info_important "[ ] Fetch tab config"
info_important "[ ] Configure Gnome Terminal"
info_important "[ ] Configure Mopidy (login, add keys, etc)"
info_important "[ ] Log into lastpass (lpass-cli login <email>)"
info_important "[ ] Pair KDE Connect to phone"
info_important "[ ] Install Software including:"
info_important " - Eclipse"
info_important " - Discord"
info_important " - Typora"
info_important " - Xournal"
info_important " - Zoom"
info_important " - Skype"
info_important " - cmatrix, neofetch"
info_important " - gotop (binary)"
info_ascii