-
Notifications
You must be signed in to change notification settings - Fork 0
/
4_cdx.sh
executable file
·561 lines (425 loc) · 18 KB
/
4_cdx.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
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
#!/bin/fish
# Source Helper
set SCRIPT_DIR (cd (dirname (status -f)); and pwd)
source "$SCRIPT_DIR/helperf.fish"
# Git clone helper
function klone
for i in (seq 10)
git clone "$argv[1]" && break
end
end
# Create the user local bin
mkdir -p $HOME/.local/bin/
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Installing Python Modules...------------------------------"
echo "------------------------------------------------------------------------"
echo ""
# FIX WARNING
set pyloc (sudo fd . /usr/lib/ --type f --max-depth 2 | grep "EXTERNALLY-MANAGED" | head -1)
sudo rm -rf "$pyloc"
# PREVENT PYTHON FROM UPGRADING
sudo sed -i "25s/.*/IgnorePkg = python/" /etc/pacman.conf
# UPGRADE PIP TO LATEST VERSION
install "python-pip" "pac"
for i in (seq 2)
python -m ensurepip --upgrade
pip install --upgrade pip
pip install setuptools
pip install sortedcontainers
end
# ======================================================= Can Be Deleted for minimal install =======================================================
# PYTHON MODULES
for i in (seq 2)
pip install virtualenv twine wheel
pip install pygobject
end
# JUPYTER SETUP
for i in (seq 3)
pip install jupyter pandas matplotlib numpy scikit-learn openpyxl xlrd networkx graphviz
pip install notebook==6.4.12
pip install pygments tqdm
pip install lxml html5lib
pip install notebook-as-pdf jupyter_contrib_nbextensions jupyter_nbextensions_configurator nbconvert
jupyter contrib nbextension install --user
jupyter nbextensions_configurator enable --user
pyppeteer-install
yes | pip uninstall notebook traitlets
pip install notebook traitlets
end
# CONDA
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
touch ~/.config/conda-deactivated
# PYTHON MISC
pip install pyautogui pynput
pip install pyfzf
pip install poetry
pip install rich pygments
# ======================================================= END ======================================================================================
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Installing Node Modules...--------------------------------"
echo "------------------------------------------------------------------------"
echo ""
# DOWNLOAD NODEJS
set ver (curl https://nodejs.org/en | grep -o '<a .*href=.*>' | sed -e 's/<a /\n<a /g' | sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d' | grep -E "node-v"|head -1|cut -d"/" -f5|xargs)
wget "https://nodejs.org/dist/$ver/node-$ver-linux-x64.tar.xz" -O $HOME/node.tar.xz
tar -xf $HOME/node.tar.xz -C $HOME
rm -rf $HOME/node.tar.xz
mv $HOME/node-"$ver"-linux-x64 $HOME/.local/bin/nodeJS
source $HOME/.config/fish/config.fish
# NODE MODULES
for i in (seq 3)
npm update -g npm
npm install npm@latest -g
npm i -g console-log-cleaner
npm i -g md-to-pdf
sudo mv $HOME/.local/bin/nodeJS/lib/node_modules/md-to-pdf/node_modules/highlight.js/styles/base16/* $HOME/.local/bin/nodeJS/lib/node_modules/md-to-pdf/node_modules/highlight.js/styles
sudo rm -rf $HOME/.local/bin/nodeJS/lib/node_modules/md-to-pdf/node_modules/highlight.js/styles/base16/
end
# Bun
curl -fsSL https://bun.sh/install | bash
# ======================================================= Can Be Deleted for minimal install =======================================================
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Installing Rust...----------------------------------------"
echo "------------------------------------------------------------------------"
echo ""
# INSTALL RUST
function installRust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
rustup default stable
end
for i in (seq 10)
if test -f ~/.cargo/bin/rustc
break
else
installRust
end
end
klone "https://github.com/rust-analyzer/rust-analyzer.git"
cd rust-analyzer
rustup default stable
cargo xtask install --server
cd ..
rm -rf rust-analyzer
# RUST MODULES
cargo install ripdrag
cargo install csvlens
cargo install --git https://github.com/loichyan/nerdfix.git
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Installing Golang...--------------------------------------"
echo "------------------------------------------------------------------------"
echo ""
# INSTALL GOLANG
function installGolang
cd ~/.local/bin
curl https://go.dev/dl/ | grep -e linux | head -2 | grep -e href | awk -F href '{print $2}' | tr -d "=" | tr -d ">" | xargs -I {} wget https://go.dev{} -O go.tar.gz
tar -xzf go.tar.gz
rm -rf go.tar.gz
mv ./go ./golang
cd
end
for i in (seq 10)
cd
if test -d ~/.local/bin/golang/
break
else
installGolang
end
end
# GOLANG MODULES
go install github.com/ericchiang/pup@latest
go install golang.org/x/tools/gopls@latest
go install github.com/segmentio/golines@latest
go install golang.org/x/tools/cmd/goimports@latest
go install mvdan.cc/gofumpt@latest
go install github.com/fatih/gomodifytags@latest
go install github.com/josharian/impl@latest
go install github.com/koron/iferr@latest
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Installing Clangd...--------------------------------------"
echo "------------------------------------------------------------------------"
echo ""
# INSTALL CLANGD LSP
install "clang" "pac"
set clangd_ver (curl "https://github.com/clangd/clangd" | grep -o '<a .*href=.*>' | sed -e 's/<a /\n<a /g' | sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d' | grep -i "releases/tag" | cut -d"/" -f6|xargs)
wget "https://github.com/clangd/clangd/releases/download/$clangd_ver/clangd-linux-$clangd_ver.zip" -O $HOME/clangd.zip
unzip $HOME/clangd.zip -d $HOME
rm -rf $HOME/clangd.zip
mv $HOME/clangd_"$clangd_ver" $HOME/.local/bin/clangd
source $HOME/.config/fish/config.fish
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Installing LUA LSP AND LUA FORMATTER...-------------------"
echo "------------------------------------------------------------------------"
echo ""
# INSTALL LUA LSP
set lua_ver (curl "https://github.com/LuaLS/lua-language-server" | grep -o '<a .*href=.*>' | sed -e 's/<a /\n<a /g' | sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d' | grep -i "releases/tag" | cut -d"/" -f6|xargs)
wget "https://github.com/LuaLS/lua-language-server/releases/download/$lua_ver/lua-language-server-$lua_ver-linux-x64.tar.gz" -O $HOME/lua-ls.tar.gz
mkdir -p $HOME/lua-ls
tar -xf $HOME/lua-ls.tar.gz -C $HOME/lua-ls/
rm -rf $HOME/lua-ls.tar.gz
mv $HOME/lua-ls $HOME/.local/bin/luaLSP
# INSTALL LUA FORAMTTER
cargo install stylua
# ======================================================= END ======================================================================================
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Installing Fuzzy File Finder (fzf)...---------------------"
echo "------------------------------------------------------------------------"
echo ""
# FZF TERMINAL INTEGRATION
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
yes | ~/.fzf/install
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Installing terminal utilities...--------------------------"
echo "------------------------------------------------------------------------"
echo ""
# INSTALL xhibit
# ===================== XORG Dependent ===================================
install "xorg-xdpyinfo xorg-xprop xorg-xwininfo xdotool" "pac"
# ===================== END Dependent ====================================
install "lsb-release" "pac"
pip install xhibit
# INSTALL sYT
pip install numerize
klone "https://github.com/glowfi/sYT"
cp -r sYT/sYT.py $HOME/.local/bin/
cp -r sYT/sYT.sh $HOME/.local/bin/
rm -rf sYT
chmod +x $HOME/.local/bin/sYT.py
chmod +x $HOME/.local/bin/sYT.sh
mkdir -p .config/mpv/scripts
touch $HOME/.config/mpv/mpv.conf
echo "script-opts-append=ytdl_hook-ytdl_path=yt-dlp" >>$HOME/.config/mpv/mpv.conf
# MPV Scripts
### WebM maker for mpv
mkdir -p $HOME/.config/mpv/scripts
wget https://github.com/ekisu/mpv-webm/releases/download/latest/webm.lua -P $HOME/.config/mpv/scripts
### Thumbnail maker
wget "https://raw.githubusercontent.com/po5/thumbfast/master/thumbfast.lua" -P $HOME/.config/mpv/scripts
wget "https://raw.githubusercontent.com/po5/thumbfast/vanilla-osc/player/lua/osc.lua" -P $HOME/.config/mpv/scripts
### Get the file path, timestamps, and cropping coordinates, for ffmpeg, all from within mpv
cd .config/mpv/scripts/
klone "https://github.com/4ndrs/PureMPV"
cd
### MPV configuration
echo 'save-position-on-quit' >>$HOME/.config/mpv/mpv.conf
# SCRIPTS
### Utils related scripts
# ===================== XORG Dependent ===================================
install "xorg-xrandr" "pac"
cp -r $HOME/setup/scripts/utils/dm-record.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/dm-record.sh
# ===================== END Dependent ====================================
cp -r $HOME/setup/scripts/utils/sgrec.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/sgrec.sh
cp -r $HOME/setup/scripts/utils/windowshot.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/windowshot.sh
cp -r $HOME/setup/scripts/utils/opa.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/opa.sh
cp -r $HOME/setup/scripts/utils/send.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/send.sh
cp -r $HOME/setup/scripts/utils/prev.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/prev.sh
cp -r $HOME/setup/scripts/utils/gtfu.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/gtfu.sh
cp -r $HOME/setup/scripts/utils/blank.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/blank.sh
cp -r $HOME/setup/scripts/utils/mp $HOME/.local/bin/
chmod +x $HOME/.local/bin/mp
cp -r $HOME/setup/scripts/utils/dex.py $HOME/.local/bin/
chmod +x $HOME/.local/bin/dex.py
cp -r $HOME/setup/scripts/utils/int.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/int.sh
cp -r $HOME/setup/scripts/utils/formatDisk.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/formatDisk.sh
cp -r $HOME/setup/scripts/utils/rename.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/rename.sh
cp -r $HOME/setup/scripts/utils/killprocess.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/killprocess.sh
cp -r $HOME/setup/scripts/utils/timer $HOME/.local/bin/
chmod +x $HOME/.local/bin/timer
cp -r $HOME/setup/scripts/utils/searchArchive.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/searchArchive.sh
cp -r $HOME/setup/scripts/utils/b64i $HOME/.local/bin/
chmod +x $HOME/.local/bin/b64i
cp -r $HOME/setup/scripts/utils/rlt $HOME/.local/bin/
chmod +x $HOME/.local/bin/rlt
cp -r $HOME/setup/scripts/utils/cpx $HOME/.local/bin/
chmod +x $HOME/.local/bin/cpx
klone "https://github.com/thameera/vimv"
cd vimv
cp -r vimv $HOME/.local/bin/
cd ..
rm -rf vimv
yes | pip uninstall pathlib
pip install pyinstaller
pip install ffmpeg-python typing-extensions
sudo pacman -S --noconfirm gifsicle
klone "https://github.com/winstxnhdw/ezgif-essentials"
cd ezgif-essentials
pyinstaller --onefile main.py
cd dist
mv ./main $HOME/.local/bin/ezgif
cd ../..
rm -rf ezgif-essentials
pip install pathlib
yes | pip uninstall pyinstaller
cp -r $HOME/setup/scripts/utils/edit.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/edit.sh
### System related scripts
cp -r $HOME/setup/scripts/system/kdeconnect $HOME/.local/bin/
chmod +x $HOME/.local/bin/kdeconnect
cp -r $HOME/setup/scripts/system/lowbat.sh $HOME/.local/bin/
chmod +x $HOME/.local/bin/lowbat.sh
# ======================================================= Can Be Deleted for minimal install =======================================================
### SETUP DATABASE
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Setting up Database...------------------------------------"
echo "------------------------------------------------------------------------"
echo ""
install "dbeaver" "pac"
install "redis" "pac"
install "postgresql" "pac"
install "mongodb-bin mongodb-tools-bin" "yay"
sudo su - postgres -c "initdb --locale en_US.UTF-8 -D /var/lib/postgres/data;exit"
sudo systemctl start postgresql
sudo su - postgres -c "(echo $USER;echo 'password';echo 'password';echo y;)|createuser --interactive -P;createdb -O $USER delta;exit"
for i in (seq 2)
pip install pgcli
end
### Add mongodb-compass
if test "$argv[1]" = "KDE"
if test "$argv[2]" = "No"
echo "yay -S --noconfirm mongodb-compass" >> "$SCRIPT_DIR/5_kde.sh"
end
else
if test "$argv[2]" = "No"
echo "yay -S --noconfirm mongodb-compass" >> "$SCRIPT_DIR/5_dwm.sh"
end
end
### SETUP VIRTUALIZATION
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Setting up Virtualization...------------------------------"
echo "------------------------------------------------------------------------"
echo ""
bash -c '(
echo y
echo y
) | for i in {1..5}; do sudo pacman -S dnsmasq virt-manager qemu-base ebtables edk2-ovmf qemu-ui-sdl spice spice-gtk spice-vdagent qemu-hw-display-virtio-vga qemu-hw-display-virtio-vga-gl qemu-hw-display-virtio-gpu qemu-hw-display-virtio-gpu-gl qemu-hw-display-qxl virglrenderer qemu-hw-usb-redirect qemu-hw-usb-host qemu-ui-spice-app qemu-audio-spice virt-viewer qemu-audio-pa qemu-audio-pipewire && break || sleep 1; done'
install "libvirt" "pac"
install "cdrtools" "pac"
sudo usermod -G libvirt -a "$USER"
sudo systemctl start libvirtd
cp -r $HOME/setup/scripts/virtualization/vm_download.sh $HOME/setup/scripts/virtualization/vm_setup.sh $HOME/setup/scripts/virtualization/vm_manager.sh $HOME/setup/scripts/virtualization/vm-gpu-passthrough $HOME/.local/bin
chmod +x $HOME/.local/bin/vm_download.sh $HOME/.local/bin/vm_setup.sh $HOME/.local/bin/vm_manager.sh
# ======================================================= END ======================================================================================
### Restfox
install "restfox-bin" "yay"
### SETUP DOCKER
install "docker docker-compose" "pac"
sudo systemctl start docker.service
sudo usermod -aG docker $USER
sudo chmod 666 /var/run/docker.sock
sudo systemctl stop docker.service
# ======================================================= Can Be Deleted for minimal install =======================================================
go install github.com/jesseduffield/lazydocker@latest
# ======================================================= END ======================================================================================
### DOWNLOAD NEOVIM
echo ""
echo "------------------------------------------------------------------------"
echo "--------------Installing the best text editor in the world...-----------"
echo "------------------------------------------------------------------------"
echo ""
for i in (seq 2)
pip install neovim black flake8
npm i -g neovim typescript pyright vscode-langservers-extracted ls_emmet @fsouza/prettierd eslint_d diagnostic-languageserver bash-language-server @tailwindcss/language-server browser-sync graphql-language-service-cli
pip uninstall -y cmake
end
install "cmake ninja tree-sitter tree-sitter-cli xclip shfmt meson" "pac"
install "neovim" "pac"
# ======================================================= Can Be Deleted for minimal install =======================================================
for i in (seq 6)
nvim --headless "+Lazy! sync" +qa
end
# ======================================================= END ======================================================================================
# MAKE NEOVIM HANDLE FILES IN PLAIN TEXT
xdg-mime default nvim.desktop text/plain
# COPY NEOVIM SETTINGS
cp -r $HOME/setup/configs/nvim $HOME/.config
cp -r $HOME/setup/configs/nvim/.vsnip/ $HOME
echo ""
echo "----------------------------------------------------"
echo "--------------Configuring git...--------------------"
echo "----------------------------------------------------"
echo ""
### Install Youtube-local
cd ~/.local/bin
klone "https://github.com/user234683/youtube-local"
cd youtube-local
python -m venv env
source "$HOME/.local/bin/youtube-local/env/bin/activate.fish"
pip install -r requirements.txt
deactivate
cd
### OCR
install "tesseract tesseract-data-eng" "pac"
### Cloud
npm i -g vercel
wget "https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz"
sudo tar -xvzf ./ngrok-v3-stable-linux-amd64.tgz -C /usr/local/bin/
rm ngrok-v3-stable-linux-amd64.tgz
### Ueberzug and Ueberzugpp
pip uninstall -y cmake
install "libxres openslide cmake chafa libvips libsixel python-opencv" "pac"
klone "https://github.com/jstkdng/ueberzugpp.git"
cd ueberzugpp
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
mv ./ueberzug ./ueberzugpp
mv ./ueberzugpp ~/.local/bin/
cd ..;cd ..
rm -rf ueberzugpp
# ===================== XORG Dependent ===================================
klone "https://github.com/ueber-devel/ueberzug"
cd ueberzug/
pip install .
cd ..
rm -rf ueberzug
# ===================== END Dependent ====================================
echo ""
echo "----------------------------------------------------"
echo "--------------Configuring git...--------------------"
echo "----------------------------------------------------"
echo ""
### Configuring git
install "gitui github-cli" "pac"
git config --global user.name -
git config --global user.email -
echo "[core]
pager = delta --syntax-theme 'gruvbox-dark'
[interactive]
diffFilter = delta --color-only --features=interactive
[delta]
features = decorations
[delta \"interactive\"]
keep-plus-minus-markers = false
[delta \"decorations\"]
commit-decoration-style = blue ol
commit-style = raw
file-style = omit
hunk-header-decoration-style = blue box
hunk-header-file-style = red
hunk-header-line-number-style = \"#067a00\"
hunk-header-style = file line-number syntax" >>$HOME/.gitconfig