-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·1491 lines (1340 loc) · 51 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
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
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
# TODO: Convert this script to shell so it can run on lighter systems.
MISC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
if [ -n "${AUTOMATED}" ]; then
AUTOMATED_PACMAN_FLAGS="--noconfirm"
else
# You have to fill it with something otherwise you get a target error.
AUTOMATED_PACMAN_FLAGS="--confirm"
fi
echo "Linking from ${MISC_DIR} ..."
TEXT_RED='\033[0;91m'
TEXT_RESET='\033[0m'
TEXT_BLINK='\033[5m'
link_skipped_files=""
link_linked_files=""
link_overwritten_files=""
link_source() {
src="${MISC_DIR}/${1}"
overwrite="${2:-0}"
dest="${HOME}/${3:-$1}"
if [ -h "$dest" ]; then
#echo "Skipping $dest because it is already linked ..."
link_skipped_files+="$dest "
elif [ -f "$dest" ]; then
if [ "$overwrite" -eq 1 ]; then
rm -f "$dest"
#echo "Overwriting file and linking $src -> $dest ..."
link_overwritten_files+="$dest "
ln -sf "$src" "$dest"
else
echo -e "${TEXT_RED}${TEXT_BLINK}Not overwriting $dest because a file exists there!${TEXT_RESET}"
fi
elif [ -d "$dest" ]; then
if [ "$overwrite" -eq 1 ]; then
rm -rf "$dest"
#echo "Overwriting directory and linking $src -> $dest ..."
link_overwritten_files+="$dest "
ln -sf "$src" "$dest"
else
echo -e "${TEXT_RED}${TEXT_BLINK}Not overwriting $dest because a directory exists there!${TEXT_RESET}"
fi
else
#echo "Linking $src -> $dest ..."
link_linked_files+="$dest "
ln -sf "$src" "$dest"
fi
}
# Dot files
link_source .ctags 1
link_source .bashrc 1
link_source .zshrc 1
link_source .tmux.conf 1
link_source .tmux.sh 1
link_source .tmuxline.conf 1
link_source .Xdefaults 1
link_source .Xdefaults 1 .Xresources
link_source .eslintrc.json 0
link_source ".gtkrc-2.0" 0
link_source .xinitrc 0
link_source .xprofile 0
link_source .warprc 0
link_source .lcovrc 1
link_source .lcovrc.gcov.css 1
# Dot directories
mkdir -p "${HOME}/.config/"
mkdir -p "${HOME}/.ncmpcpp"
link_source "config/ncmpcpp/config" 1 ".ncmpcpp/config"
mkdir -p "${HOME}/.gnupg"
link_source "config/gnupg/gpg.conf" 0 ".gnupg/gpg.conf"
mkdir -p "${HOME}/.ssh"
link_source "config/ssh/config" 0 ".ssh/config"
link_source "config/ssh/aws-ssm-ec2-proxy-command.sh" 1 ".ssh/aws-ssm-ec2-proxy-command.sh"
# Linked folders
link_source "config/SpaceVim.d" 1 ".SpaceVim.d"
link_source ".tmuxp" 1
# Configure secured password (not included in this repo) with:
# /secure passphrase a strong password here
# /secure set freenode_password yourFreenodePasswordHere
link_source "config/weechat/" 1 ".weechat"
if [ ! -d "${HOME}/.tmux/plugins/tpm" ]; then
git clone "https://github.com/tmux-plugins/tpm" "${HOME}/.tmux/plugins/tpm"
fi
# ~/.config/
link_source "config/i3/" 1 ".config/i3"
link_source "config/mpd/" 1 ".config/mpd"
link_source "config/polybar/" 1 ".config/polybar"
link_source "config/psd/" 1 ".config/psd"
link_source "config/compton/" 1 ".config/compton"
link_source "config/awesome/" 1 ".config/awesome"
link_source "config/gtk-3.0/" 0 ".config/gtk-3.0"
link_source "config/ranger/" 1 ".config/ranger"
link_source "config/rofi/" 1 ".config/rofi"
link_source "config/nvim/" 1 ".config/nvim"
link_source "config/newsboat/" 1 ".config/newsboat"
link_source "config/zathura/" 1 ".config/zathura"
link_source "config/bspwm/" 1 ".config/bspwm"
link_source "config/sxhkd/" 1 ".config/sxhkd"
link_source "config/dunst/" 1 ".config/dunst"
link_source "config/fontconfig/" 0 ".config/fontconfig"
link_source "config/pcmanfm/" 1 ".config/pcmanfm"
link_source "config/xmrig.json" 1 ".config/xmrig.json"
link_source "config/redrum.ini" 1 ".config/redrum.ini"
link_source "config/btop/" 1 ".config/btop"
link_source "config/Kvantum/" 1 ".config/Kvantum"
mkdir -p "${HOME}/.local/share/applications/"
link_source "config/mimeapps.list" 1 ".config/mimeapps.list"
link_source "config/mimeapps.list" 1 ".local/share/applications/mimeapps.list"
mkdir -p "${HOME}/.config/variety"
link_source "config/variety/variety.conf" 1 ".config/variety/variety.conf"
mkdir -p "${HOME}/.config/copyq"
link_source "config/copyq/copyq-commands.ini" 1 ".config/copyq/copyq-commands.ini"
link_source "config/copyq/copyq.conf" 1 ".config/copyq/copyq.conf"
link_source "config/copyq/copyq-filter.ini" 1 ".config/copyq/copyq-filter.ini"
link_source "config/copyq/copyq_geometry.ini" 1 ".config/copyq/copyq_geometry.ini"
link_source "config/copyq/copyq_tabs.ini" 1 ".config/copyq/copyq_tabs.ini"
# We only want to copy the roles folder from sgpt; the .sgptrc file contains our OpenAI key
mkdir -p "${HOME}/.config/shell_gpt/roles/"
link_source "config/shell_gpt/roles/" 1 ".config/shell_gpt/roles"
# We link for both the regular and Flatpak versions of FreeCAD.
mkdir -p "${HOME}/.var/app/org.freecadweb.FreeCAD/config/FreeCAD"
link_source "config/FreeCAD/user.cfg" 1 ".var/app/org.freecadweb.FreeCAD/config/FreeCAD/user.cfg"
mkdir -p "${HOME}/.config/FreeCAD"
link_source "config/FreeCAD/user.cfg" 1 ".config/FreeCAD/user.cfg"
# awcli
mkdir -p "${HOME}/.aws"
link_source "config/aws/config" 0 ".aws/config"
# Binaries / executables
mkdir -p "${HOME}/bin/"
link_source "bin/ctlpanel" 1
link_source "bin/gspeak" 1
link_source "bin/idle-mine" 1
link_source "bin/reload-kde" 1
link_source "bin/restart-kde" 1
link_source "bin/logout-kde" 1
echo "Overwritten files: ${link_overwritten_files}"
echo "Linked files: ${link_linked_files}"
echo "Skipped files: ${link_skipped_files}"
echo "Environment installation complete"
read -r -p "Would you like to attempt an install of common utilities? [y/N] " response
case "$response" in
[yY][eE][sS] | [yY])
# TODO: Verify weechat plugins are installed (probably aren't).
if [[ -x "$(command -v dnf)" ]]; then
# shell-gpt needs python3-devel on Fedora.
# gem needs ruby-devel on Fedora.
sudo dnf install -y \
btop \
ctags \
curl \
dnf-plugins-core \
fastfetch \
gcc \
git \
git-crypt \
git-lfs \
gnupg2 \
keychain \
make \
neovim \
newsboat \
nodejs \
nodejs-npm \
pipx \
python3 \
python3-devel \
python3-neovim \
python3-pip \
ripgrep \
ruby-devel \
rubygems \
tmux \
util-linux-user \
weechat \
xsel \
zsh
elif [[ -x "$(command -v brew)" ]]; then
# macOS has outdated version of curl, make, binutils, gcc
# macOS login needs pinentry-mac in order to complete gpg git commit signing
brew install \
binutils \
btop \
chezmoi \
ctags \
curl \
fastfetch \
gcc \
gh \
git \
git-crypt \
git-lfs \
gnupg \
keychain \
libtool \
make \
neovim \
newsboat \
node \
pinentry-mac \
pipx \
pkg-config \
python \
ripgrep \
tmux \
weechat \
xsel \
zsh
elif [[ -x "$(command -v emerge)" ]]; then
# Possibly missing: npm, python3-neovim
sudo emerge --noreplace \
app-crypt/gnupg \
app-editors/neovim \
app-misc/fastfetch \
app-misc/tmux \
app-shells/zsh \
dev-build/make \
dev-lang/python \
dev-lang/ruby \
dev-python/pip \
dev-python/pipx \
dev-ruby/rubygems \
dev-util/ctags \
dev-vcs/git \
dev-vcs/git-crypt \
dev-vcs/git-lfs \
net-irc/weechat \
net-libs/nodejs \
net-misc/curl \
net-misc/keychain \
net-news/newsboat \
sys-apps/ripgrep \
sys-apps/util-linux \
sys-devel/gcc \
sys-process/btop \
x11-misc/xsel
elif [[ -x "$(command -v apt-get)" ]]; then
sudo apt-get install -y \
btop \
ctags \
curl \
gcc \
git \
git-crypt \
git-lfs \
gpg \
keychain \
make \
neofetch \
neovim \
newsboat \
nodejs \
npm \
pipx \
python3 \
python3-pip \
python3-pynvim \
ripgrep \
ruby-rubygems \
tmux \
weechat \
xsel \
zsh
elif [[ -x "$(command -v pacman)" ]]; then
sudo pacman -Syu --needed "$AUTOMATED_PACMAN_FLAGS" \
btop \
chezmoi \
ctags \
curl \
gcc \
git \
git-crypt \
git-lfs \
github-cli \
gnupg \
keychain \
make \
neovim \
newsboat \
nodejs \
npm \
python \
python-pip \
python-pipx \
python-pynvim \
ripgrep \
rubygems \
tmux \
weechat \
xsel \
zsh
if [[ -x "$(command -v yay)" ]]; then
yay -Syu "$AUTOMATED_PACMAN_FLAGS" \
aws-cli-v2 \
fastfetch \
--needed
fi
elif [[ -x "$(command -v pkg)" ]]; then
sudo pkg install \
btop \
chezmoi \
ctags \
curl \
fastfetch \
gcc \
gh \
git \
git-crypt \
git-lfs \
gmake \
gnupg \
keychain \
neovim \
newsboat \
node \
npm \
py39-pip \
py39-pipx \
py39-pynvim \
python \
ripgrep \
ruby \
tmux \
weechat \
xsel \
zsh
fi
if [[ ! -x "$(command -v chezmoi)" ]]; then
previous_dir="$(pwd)"
cd "${HOME}" && curl -sfL https://git.io/chezmoi | sh
cd "$previous_dir" || exit
fi
if [[ -x "$(command -v pip2)" ]]; then
pip2 install --user \
neovim
fi
if [[ -x "$(command -v pipx)" ]]; then
pipx install ansible
pipx install ansible-core
pipx install ansible-lint
pipx install ansible-navigator
pipx install argcomplete
pipx install bandit
pipx install black
pipx install flake8
pipx install flake8-pyproject
pipx install huggingface_hub
pipx install isort
pipx install molecule
pipx install neovim
pipx install poetry
pipx install pre-commit
pipx install shell-gpt
pipx install thefuck
pipx install tmuxp
elif [[ -x "$(command -v pip3)" ]]; then
pip3 install --user \
ansible \
ansible-core \
ansible-lint \
argcomplete \
bandit \
black \
flake8 \
huggingface_hub \
isort \
neovim \
poetry \
shell-gpt \
thefuck \
tmuxp
else
echo "You need to install pipx / pip3"
fi
# TODO: install LTS node via NVM which is installed via ZSH.
if [[ -x "$(command -v npm)" ]]; then
npm install -g neovim || sudo npm install -g neovim
npm install -g @bazel/bazelisk || sudo npm install -g @bazel/bazelisk
# I set this up to use npx instead
#npm install -g bash-language-server
else
echo "You need to install npm"
fi
if [[ -x "$(command -v gem)" ]]; then
gem install \
neovim \
taskjuggler
else
echo "You need to install gem"
fi
if [[ ! -d "${HOME}/.cache/dein" ]]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Shougo/dein-installer.vim/master/installer.sh)" -- "${HOME}/.cache/dein" --use-neovim-config
fi
# Forcibly fix permissions on the GnuPG directory
chmod u+rwx,go-rwx "${HOME}/.gnupg"
# Pull GPG keys for [email protected]
gpg --receive-keys 9AC8DC8D17BA0401CBD0F4E16077844530A4A68E
# Gentoo keys
gpg --keyserver hkps://keys.gentoo.org --receive-keys 13EBBDBEDE7A12775DFDB1BABB572E0E2D182910
# FreeBSD team keys
curl -s https://docs.freebsd.org/pgpkeys/pgpkeys.txt | gpg --import
# Linux Kernel
# https://www.kernel.org/signature.html
## Linus Torvalds
gpg --receive-keys ABAF11C65A2970B130ABE3C479BE3E4300411886
## Greg Kroah-Hartman
gpg --receive-keys 647F28654894E3BD457199BE38DBBDC86092693E
## Sasha Levin
gpg --receive-keys E27E5D8A3403A2EF66873BBCDEA66FF797772CDC
## Ben Hutchings
gpg --receive-keys AC2B29BD34A6AFDDB3F68F35E7BFC8EC95861109
## Seth Forshee, maintainer of wireless-regdb who has a built-in key in the kernel
gpg --receive-keys 2ABCA7498D83E1D32D51D3B5AB4800A62DB9F73A
# Arch Linux Official Keys
# https://archlinux.org/master-keys/
## Florian Pritz
gpg --receive-keys 91FFE0700E80619CEB73235CA88E23E377514E00
## Levente Polyak
gpg --receive-keys D8AFDDA07A5B6EDFA7D8CCDAD6D055F927843F1C
## David Runge
gpg --receive-keys 2AC0A42EFB0B5CBC7A0402ED4DC95B6D7BE9892E
## Johannes Löthberg
gpg --receive-keys 69E6471E3AE065297529832E6BA0F5A2037F4F41
## Leonidas Spyropoulos
gpg --receive-keys 3572FA2A1B067F22C58AF155F8B821B42A6FDCD7
# AWS CLI Team
gpg --keyserver keyserver.ubuntu.com --receive-keys FB5DB77FD5C118B80511ADA8A6310ACC4672475C
# Github CLI: [email protected]
## You may need this:
## https://github.com/cli/cli/issues/9569
gpg --receive-keys 2C6106201985B60E6C7AC87323F3D4EA75716059
if [ -s /bin/zsh ]; then
if [[ ! "$SHELL" =~ "zsh" ]]; then
chsh -s /bin/zsh "${USER}"
fi
fi
;;
*)
echo "Skipping common utility installation"
;;
esac
read -r -p "Would you like to install AWS CLI (v2)? [y/N] " response
case "$response" in
[yY][eE][sS] | [yY])
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip.sig" -o "awscliv2.sig"
gpg --verify "awscliv2.sig" "awscliv2.zip"
unzip awscliv2.zip
if [ -d "${HOME}/.local/share/aws-cli" ]; then
./aws/install --bin-dir "${HOME}/.local/bin" --install-dir "${HOME}/.local/share/aws-cli" --update
else
./aws/install --bin-dir "${HOME}/.local/bin" --install-dir "${HOME}/.local/share/aws-cli"
fi
rm -rf awscliv2.zip awscliv2.sig aws
aws --version
;;
*)
echo "Skipping AWS CLI installation"
;;
esac
read -r -p "Would you like to add unofficial package repositories? [y/N] " response
case "$response" in
[yY][eE][sS] | [yY])
if [[ -x "$(command -v dnf)" ]]; then
sudo dnf install -y "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm"
sudo dnf install -y "https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
# Add repo for Brave
sudo dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
sudo rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
# Add repo for Docker
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
# Import PGP key for VeraCrypt.
sudo rpm --import https://www.idrix.fr/VeraCrypt/VeraCrypt_PGP_public_key.asc
# Add Copr repo for OpenVPN Connect
## This repo does not have an x64 build for Fedora 39 for some reason?
##sudo dnf copr enable dsommers/openvpn3
# This one works:
sudo dnf copr enable ojab/openvpn3
# Add Copr repo for Bazel
# This is WAY out of date. Do not use!
# Add Signal Desktop repo
sudo dnf config-manager --add-repo "https://download.opensuse.org/repositories/network:im:signal/Fedora_$(rpm -E %fedora)/network:im:signal.repo"
# Add Github CLI repo
sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
# Update all the new repositories
sudo dnf check-update --refresh
if [ -n "${AUTOMATED}" ]; then
response='n'
else
read -r -p "Would you like to install Brave? [y/N] " response
fi
case "$response" in
[yY][eE][sS] | [yY])
sudo dnf install -y brave-browser
;;
*)
echo "Skipping Brave installation"
;;
esac
if [ -n "${AUTOMATED}" ]; then
response='n'
else
read -r -p "Would you like to install Docker? [y/N] " response
fi
case "$response" in
[yY][eE][sS] | [yY])
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable docker
sudo systemctl start docker
;;
*)
echo "Skipping Docker installation"
;;
esac
read -r -p "Would you like to install AWS Session Manager Plugin? [y/N] " response
case "$response" in
[yY][eE][sS] | [yY])
sudo dnf install -y https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm
;;
*)
echo "Skipping AWS Session Manager Plugin installation"
;;
esac
read -r -p "Would you like to install Github CLI? [y/N] " response
case "$response" in
[yY][eE][sS] | [yY])
sudo dnf install -y gh
;;
*)
echo "Skipping Github CLI installation"
;;
esac
if [ -n "${AUTOMATED}" ]; then
response='n'
else
read -r -p "Would you like to install Signal Desktop? [y/N] " response
fi
case "$response" in
[yY][eE][sS] | [yY])
sudo dnf install -y signal-desktop
;;
*)
echo "Skipping Signal Desktop installation"
;;
esac
elif [[ -x "$(command -v apt-get)" ]]; then
# Install tools for adding repositories
sudo apt-get install -y apt-transport-https
# Make sure the keyrings directory exists
sudo mkdir -p -m 755 /etc/apt/keyrings
# Keys and repository for Kubernetes
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # allow unprivileged APT programs to read this keyring
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list # helps tools such as command-not-found to work correctly
# Keys and repository for Helm
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
# Keys and repository for Github CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt-get update
read -r -p "Would you like to install AWS Session Manager Plugin? [y/N] " response
case "$response" in
[yY][eE][sS] | [yY])
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb"
sudo dpkg -i "session-manager-plugin.deb"
rm -f "session-manager-plugin.deb"
;;
*)
echo "Skipping AWS Session Manager Plugin installation"
;;
esac
read -r -p "Would you like to install Kubernetes? [y/N] " response
case "$response" in
[yY][eE][sS] | [yY])
sudo apt-get install -y kubectl
;;
*)
echo "Skipping Kubernetes installation"
;;
esac
read -r -p "Would you like to install Helm? [y/N] " response
case "$response" in
[yY][eE][sS] | [yY])
sudo apt-get install -y helm
;;
*)
echo "Skipping Helm installation"
;;
esac
read -r -p "Would you like to install Github CLI? [y/N] " response
case "$response" in
[yY][eE][sS] | [yY])
sudo apt-get install -y gh
;;
*)
echo "Skipping Github CLI installation"
;;
esac
elif [[ -x "$(command -v pacman)" ]]; then
echo "No repositories for pacman yet"
# TODO: Set up yay.
fi
;;
*)
echo "Skipping unofficial package repository installation"
;;
esac
if [ -n "${AUTOMATED}" ]; then
response='n'
else
read -r -p "Would you like to attempt an install of bspwm? [y/N] " response
fi
case "$response" in
[yY][eE][sS] | [yY])
if [[ -x "$(command -v dnf)" ]]; then
# TODO: Fill the rest in.
sudo dnf install \
@base-x \
bspwm \
copyq \
dunst \
lxappearance \
materia-gtk-theme \
materia-kde \
nitrogen \
papirus-icon-theme \
pcmanfm \
qt6ct \
rofi \
sxhkd \
sxiv \
variety \
yad \
xarchiver \
-y
elif [[ -x "$(command -v apt-get)" ]]; then
# NetworkManager pre-installed.
sudo apt-get install \
bspwm \
copyq \
dunst \
lxappearance \
materia-gtk-theme \
materia-kde \
murrine-themes \
nitrogen \
papirus-icon-theme \
pcmanfm \
qt6ct \
rofi \
sxhkd \
sxiv \
variety \
xarchiver \
xorg \
yad \
-y
echo "You will need to build polybar from source: https://github.com/polybar/polybar/wiki/Compiling"
echo "python-xcbgen may need to be changed to python3-xcbgen"
sudo apt-get install -y build-essential git cmake cmake-data pkg-config python3-sphinx python3-packaging libcairo2-dev libxcb1-dev libxcb-util0-dev libxcb-randr0-dev libxcb-composite0-dev python-xcbgen xcb-proto libxcb-image0-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-xkb-dev libxcb-xrm-dev libxcb-cursor-dev libasound2-dev libpulse-dev i3-wm libjsoncpp-dev libmpdclient-dev libcurl4-openssl-dev libnl-genl-3-dev
echo "You will need to build picom from source: https://github.com/yshui/picom#build"
sudo apt-get install -y libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre2-dev libpcre3-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev
elif [[ -x "$(command -v pacman)" ]]; then
sudo pacman -Syu "$AUTOMATED_PACMAN_FLAGS" \
bspwm \
copyq \
dunst \
gtk-engine-murrine \
kvantum-theme-materia \
lxappearance \
materia-gtk-theme \
materia-kde \
network-manager-applet \
nitrogen \
nm-connection-editor \
papirus-icon-theme \
pcmanfm-gtk3 \
picom \
polybar \
qt6ct \
rofi \
sxhkd \
variety \
xarchiver \
xorg-server \
yad \
--needed
if [[ -x "$(command -v yay)" ]]; then
yay -Syu "$AUTOMATED_PACMAN_FLAGS" \
ly \
nsxiv \
--needed
fi
elif [[ -x "$(command -v pkg)" ]]; then
sudo pkg install \
Kvantum-qt5 \
bspwm \
copyq \
dunst \
gtk-murrine-engine \
lxappearance \
ly \
materia-gtk-theme \
ncurses \
nitrogen \
nsxiv \
papirus-icon-theme \
pcmanfm-gtk3 \
picom \
pidof \
polybar \
qt6ct \
rofi \
sxhkd \
variety \
xarchiver \
xorg \
yad
# Could not find these:
#materia-kde \
#network-manager-applet \
#nm-connection-editor \
fi
#if [[ -x "$(command -v pip3)" ]]; then
#pip3 install --user \
#fi
# copy service files
#mkdir -p ~/.config/systemd/user/
#cp -u services/redrum.service ~/.config/systemd/user/
#cp -u services/redrum.timer ~/.config/systemd/user/
# enable and start systemd timer
#systemctl --user enable redrum.timer
#systemctl --user start redrum.timer
# the service can be triggered manually as well
#systemctl --user start redrum
;;
*)
echo "Skipping bspwm installation"
;;
esac
if [ -n "${AUTOMATED}" ]; then
response='n'
else
read -r -p "Would you like to attempt an install of workstation utilities? [y/N] " response
fi
case "$response" in
[yY][eE][sS] | [yY])
if [[ -x "$(command -v dnf)" ]]; then
sudo dnf install \
brave-browser \
dex-autostart \
firefox \
flameshot \
google-noto-emoji-color-fonts \
gparted \
inkscape \
libreoffice \
mpv \
nextcloud-client \
p7zip \
qalculate-gtk \
touchegg \
veracrypt \
zathura \
zathura-pdf-mupdf \
-y
elif [[ -x "$(command -v brew)" ]]; then
brew install \
ffmpeg \
minikube \
p7zip \
qalculate-gtk \
qemu \
rar
brew install --cask \
brave-browser \
docker \
flameshot \
inkscape \
iterm2 \
joplin \
libreoffice \
mpv \
nextcloud \
utm \
veracrypt \
vlc \
wireshark
elif [[ -x "$(command -v emerge)" ]]; then
# Possibly missing: brave-browser, touchegg
sudo emerge --noreplace \
app-arch/p7zip \
app-crypt/veracrypt \
app-office/libreoffice \
app-text/zathura \
app-text/zathura-pdf-mupdf \
media-fonts/noto-emoji \
media-gfx/flameshot \
media-gfx/inkscape \
media-video/mpv \
net-misc/nextcloud-client \
sci-calculators/qalculate-gtk \
sys-block/gparted \
www-client/firefox \
x11-misc/dex
elif [[ -x "$(command -v apt-get)" ]]; then
sudo apt-get install \
dex \
flameshot \
fonts-noto-color-emoji \
gparted \
inkscape \
libreoffice \
mpv \
nextcloud-desktop \
p7zip-full \
qalculate-gtk \
touchegg \
unrar \
zathura \
-y
# TODO: Add ppa for veracrypt on Ubuntu
# TODO: Add ppa for Brave on Ubuntu
elif [[ -x "$(command -v pacman)" ]]; then
sudo pacman -Syu "$AUTOMATED_PACMAN_FLAGS" \
dex \
flameshot \
girara \
gnome-keyring \
inkscape \
libreoffice-fresh \
mpv \
nextcloud-client \
noto-fonts-emoji \
p7zip \
qalculate-gtk \
touchegg \
unrar \
veracrypt \
zathura \
zathura-pdf-mupdf \
--needed
if [[ -x "$(command -v yay)" ]]; then
yay -Syu "$AUTOMATED_PACMAN_FLAGS" \
brave-bin \
--needed
fi
elif [[ -x "$(command -v pkg)" ]]; then
# FreeBSD does not have dex
sudo pkg install \
flameshot \
girara \
gnome-keyring \
inkscape \
libreoffice \
mpv \
nextcloudclient \
noto-emoji \
qalculate-gtk \
touchegg \
unrar \
veracrypt \
zathura \
zathura-pdf-mupdf
fi
if [[ ! -x "$(command -v brew)" ]]; then
if [ -s /usr/share/applications/brave.desktop ]; then
xdg-settings set default-web-browser brave.desktop
elif [ -s /usr/share/applications/brave-browser.desktop ]; then
xdg-settings set default-web-browser brave-browser.desktop
fi
# Install NordVPN CLI tool.
sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)
# Install/update Joplin
curl https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash
fi
if [[ ! -x "$(command -v veracrypt)" ]]; then
if [ -n "${AUTOMATED}" ]; then
response='n'
else
read -r -p "You must manually download and install VeraCrypt. Would you like to go there now? [y/N] " response
fi
case "$response" in
[yY][eE][sS] | [yY])
xdg-open 'https://veracrypt.eu/en/Downloads.html'
;;
*)
echo "Skipping VeraCrypt installation"
;;
esac
fi
# Install yt-dlp, to nightly edition
if [[ ! -x "$(command -v yt-dlp)" ]]; then
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/.local/bin/yt-dlp
chmod a+rx ~/.local/bin/yt-dlp
yt-dlp --update-to nightly
fi
;;
*)
echo "Skipping workstation utility installation"
;;
esac
if [ -n "${AUTOMATED}" ]; then
response='n'
else
read -r -p "Would you like to setup Gnome? [y/N] " response
fi
case "$response" in