forked from flaport/home
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharch_install
executable file
·1541 lines (1370 loc) · 55.7 KB
/
arch_install
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
# _____ _ ____ ____ ____ ____ _____
# / // \ / _ \/ __\/ _ \/ __\/__ __\
# | __\| | | / \|| \/|| / \|| \/| / \
# | | | |_/\| |-||| __/| \_/|| / | |
# \_/ \____/\_/ \|\_/ \____/\_/\_\ \_/
# ---------------------------------------------------- #
# !!! NOTE THAT THIS SCRIPT SHOULD NOT BE SOURCED. !!! #
# ---------------------------------------------------- #
# last complete install: 2023.04.10
# Note: this script can be run as often as you like. It will not attempt to re-install
# any already installed program, making it a very fast way update some preferences
# or install additional packages by adding them to the list below.
# Pre-installation checks
#-------------------------------------------------------------------------------
if [ "$USER" == root ]; then
echo
echo "'arch_install' should NOT be run as root, nor should it be run with sudo."
echo "this script should be run [normally] by a user with sudo privileges."
exit 1
fi
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
echo
echo "'arch_install' should NOT be sourced."
exit 1
fi
# Parse arguments
#-------------------------------------------------------------------------------
[ ! -z "$2" ] && >&2 echo usage: arch_install [--force] && exit 1
[ ! -z "$1" ] && [ "$1" = "--force" ] && FORCE=1 || FORCE=0
# Logging
#-------------------------------------------------------------------------------
mkdir -p $HOME/.local/share
LOG="$HOME/.local/share/arch_install.log"
ERR="$HOME/.local/share/arch_install_errors.log"
printf "ARCH PACKAGE INSTALL\n\n\n" > "$LOG"
printf "ARCH PACKAGE INSTALL\n\n\n" > "$ERR"
# User input
#-------------------------------------------------------------------------------
# Ask for password, this will be used for all the sudo calls.:
# and to change the shell later on.
read -s -p "[sudo] password for $USER: " password
echo $password | sudo -S echo '' 2>/dev/null
if [ $? -ne 0 ]; then
printf "\nIncorrect sudo password. Script ended prematurely.\n\nPlease start over.\n\n"
exit 1
fi
# Update
#-------------------------------------------------------------------------------
## Update arch
printf "\n\nUpdating Arch Linux...\n\n"
printf "\n\nUpdating Arch Linux...\n\n" >> "$LOG"
printf "\n\nUpdating Arch Linux...\n\n" >> "$ERR"
echo $password | sudo -S pacman -Syu --noconfirm >> "$LOG" 2>> "$ERR"
# Custom installation functions
#-------------------------------------------------------------------------------
echo_success(){
if [ $1 -ne 0 ]; then
printf "failed!\n"
printf "\nfailed!\n" >> "$LOG"
printf "\nfailed!\n" >> "$ERR"
return 1
fi
printf "success!\n"
printf "\nsuccess!\n" >> "$LOG"
printf "\nsuccess!\n" >> "$ERR"
return 0
}
pacman_install(){ # will only install the first argument!
printf "[pacman] install $1... "
printf "\n\n\n[pacman] install $1...\n" >> "$LOG"
printf "\n\n\n[pacman] install $1...\n" >> "$ERR"
# check if package is already installed...
echo $password | sudo -S pacman -Q $1 >> "$LOG" 2>> "$ERR";
if [ $? = 0 ] && [ "$FORCE" -eq 0 ]; then
printf "already installed.\n"
printf "already installed.\n" >> "$LOG"
printf "already installed.\n" >> "$ERR"
return 1
fi
printf "sudo pacman -S --noconfirm --noprogress $1\n" >> "$LOG"
printf "sudo pacman -S --noconfirm --noprogress $1\n" >> "$ERR"
echo $password | sudo -S pacman -S --noconfirm --noprogress --overwrite='*' $1 >> "$LOG" 2>> "$ERR"
exit_code=$?
echo_success $exit_code
return $exit_code
}
yay_install(){ # will only install the first argument!
printf "[ yay ] install $1... "
printf "\n\n\n[ yay ] install $1...\n" >> "$LOG"
printf "\n\n\n[ yay ] install $1...\n" >> "$ERR"
# check if package is already installed...
echo $password | sudo -S pacman -Q $1 >> "$LOG" 2>> "$ERR";
if [ $? = 0 ] && [ "$FORCE" -eq 0 ]; then
printf "already installed.\n"
printf "already installed.\n" >> "$LOG"
printf "already installed.\n" >> "$ERR"
return 1
fi
printf "yay -S -q --noconfirm $1\n" >> "$LOG"
printf "yay -S -q --noconfirm $1\n" >> "$ERR"
yay -S -q --noconfirm --overwrite='*' $1 >> "$LOG" 2>> "$ERR"
exit_code=$?
echo_success $exit_code
return $exit_code
}
git_install(){ # will only install the first argument!
name=$(basename $1)
name=${name%.*}
printf "[ git ] install $name... "
printf "\n\n\n[ git ] install $name...\n" >> "$LOG"
printf "\n\n\n[ git ] install $name...\n" >> "$ERR"
# check if package is already installed...
echo $password | sudo -S pacman -Q $name >> "$LOG" 2>> "$ERR";
if [ $? = 0 ] && [ "$FORCE" -eq 0 ]; then
printf "already installed.\n"
printf "already installed.\n" >> "$LOG"
printf "already installed.\n" >> "$ERR"
return 1
fi
printf "git clone $1 /tmp/gitpkg\n" >> "$LOG"
printf "git clone $1 /tmp/gitpkg\n" >> "$ERR"
git clone $1 /tmp/gitpkg >> "$LOG" 2>> "$ERR"
printf "cd /tmp/gitpkg\n" >> "$LOG"
printf "cd /tmp/gitpkg\n" >> "$ERR"
cd /tmp/gitpkg >> "$LOG" 2>> "$ERR"
printf "makepkg -si --noconfirm --noprogress\n" >> "$LOG"
printf "makepkg -si --noconfirm --noprogress\n" >> "$ERR"
makepkg -si --noconfirm --noprogress >> "$LOG" 2>> "$ERR"
exit_code=$?
echo_success $exit_code
printf "cd ~\n" >> "$LOG"
printf "cd ~\n" >> "$ERR"
cd $HOME >> "$LOG" 2>> "$ERR"
printf "rm -rf /tmp/gitpkg\n" >> "$LOG"
printf "rm -rf /tmp/gitpkg\n" >> "$ERR"
rm -rf /tmp/gitpkg >> "$LOG" 2>> "$ERR"
return $exit_code
}
submodule_install(){ # will only install the first argument!
printf "[submod] install $1... "
printf "\n\n\n[submod] install $1...\n" >> "$LOG"
printf "\n\n\n[submod] install $1...\n" >> "$ERR"
printf "cd $HOME/.build/$1\n" >> "$LOG"
printf "cd $HOME/.build/$1\n" >> "$ERR"
cd "$HOME/.build/$1" >> "$LOG" 2>> "$ERR"
printf "sudo make clean\n" >> "$LOG"
printf "sudo make clean\n" >> "$ERR"
echo $password | sudo -S rm config.h >> "$LOG" 2>> "$ERR"
echo $password | sudo -S make clean >> "$LOG" 2>> "$ERR"
printf "git pull\n" >> "$LOG"
printf "git pull\n" >> "$ERR"
git checkout master >> "$LOG" 2>> "$ERR"
git pull origin master >> "$LOG" 2>> "$ERR"
printf "sudo make install\n" >> "$LOG"
printf "sudo make install\n" >> "$ERR"
echo $password | sudo -S make all >> "$LOG" 2>> "$ERR"
echo $password | sudo -S make install >> "$LOG" 2>> "$ERR"
exit_code=$?
echo_success $exit_code
echo $password | sudo -S make clean >> "$LOG" 2>> "$ERR"
echo $password | rm -f config.h >> "$LOG" 2>> "$ERR"
printf "cd $HOME\n" >> "$LOG"
printf "cd $HOME\n" >> "$ERR"
cd $HOME >> "$LOG" 2>> "$ERR"
return $exit_code
}
pip3_install() {
printf "[ pip3 ] install $1... "
printf "\n\n\n[ pip3 ] install $1\n" >> "$LOG"
printf "\n\n\n[ pip3 ] install $1\n" >> "$ERR"
# check if package is already installed...
/usr/bin/python3 -c "import $1" >/dev/null 2>/dev/null
if [ $? = 0 ] && [ "$FORCE" -eq 0 ]; then
printf "already installed.\n"
printf "already installed.\n" >> "$LOG"
printf "already installed.\n" >> "$ERR"
return 1
fi
printf "sudo /usr/bin/python3 -m pip install $1\n" >> "$LOG"
printf "sudo /usr/bin/python3 -m pip install $1\n" >> "$ERR"
echo $password | sudo -S /usr/bin/python3 -m pip install $1 >> "$LOG" 2>> "$ERR"
exit_code=$?
echo_success $exit_code
return $exit_code
}
pip2_install() {
printf "[ pip2 ] install $1... "
printf "\n\n\n[ pip2 ] install $1\n" >> "$LOG"
printf "\n\n\n[ pip2 ] install $1\n" >> "$ERR"
# check if package is already installed...
/usr/bin/python2 -c "import $1" >/dev/null 2>/dev/null
if [ $? = 0 ] && [ "$FORCE" -eq 0 ]; then
printf "already installed.\n"
printf "already installed.\n" >> "$LOG"
printf "already installed.\n" >> "$ERR"
return 1
fi
printf "sudo /usr/bin/python2 -m pip install $1\n" >> "$LOG"
printf "sudo /usr/bin/python2 -m pip install $1\n" >> "$ERR"
echo $password | sudo -S /usr/bin/python2 -m pip install $1 >> "$LOG" 2>> "$ERR"
exit_code=$?
echo_success $exit_code
return $exit_code
}
npm_install(){
printf "[ npm ] install $1... "
printf "\n\n\n[ npm ] install $1\n" >> "$LOG"
printf "\n\n\n[ npm ] install $1\n" >> "$ERR"
# check if package is already installed...
echo $password | sudo -S npm list -g 2> /dev/null | grep "$1" >/dev/null 2>/dev/null
if [ $? = 0 ] && [ "$FORCE" -eq 0 ]; then
printf "already installed.\n"
printf "already installed.\n" >> "$LOG"
printf "already installed.\n" >> "$ERR"
return 1
fi
printf "sudo npm install -g $1\n" >> "$LOG"
printf "sudo npm install -g $1\n" >> "$ERR"
echo $password | sudo -S npm install -g $1 >> "$LOG" 2>> "$ERR"
exit_code=$?
echo_success $exit_code
return $exit_code
}
systemctl_create() {
printf "[system] create $1 service... "
printf "\n\n\n[system] create $1 service...\n" >> "$LOG"
printf "\n\n\n[system] create $1 service...\n" >> "$ERR"
source=$HOME/.install/services/$1.service
target=$(head -6 $source | tail -1 | sed 's/#\ *TARGET:\ *//g')
echo $password | sudo -S systemctl daemon-reload
echo "# NOTE: THIS FILE WAS AUTO-GENERATED BY $HOME/.install/arch_install" | sudo tee $target > /dev/null 2>> "$ERR"
echo "# AND WILL PROBABLY BE OVERWRITTEN IN THE FUTURE." | sudo tee -a $target > /dev/null 2>> "$ERR"
echo "# EDIT THE SOURCE FILE AT $source" | sudo tee -a $target > /dev/null 2>> "$ERR"
echo "# and run $HOME/.install/arch_install again to install it here." | sudo tee -a $target > /dev/null 2>> "$ERR"
echo "" | sudo tee -a $target > /dev/null 2>> "$ERR"
tail --lines=+7 $source | sed 's|{USER}|'$USER'|g' | sed 's|{HOME}|'$HOME'|g' | sudo tee -a $target > /dev/null 2>> "$ERR"
exit_code=$?
echo $password | sudo -S systemctl daemon-reload
echo_success $exit_code
return $exit_code
}
systemctl_enable() {
printf "[system] enable $1 service... "
printf "\n\n\n[system] enable $1 service...\n" >> "$LOG"
printf "\n\n\n[system] enable $1 service...\n" >> "$ERR"
printf "sudo systemctl enable $1\n" >> "$LOG"
printf "sudo systemctl enable $1\n" >> "$ERR"
echo $password | sudo -S systemctl enable "$1" >> "$LOG" 2>> "$ERR"
exit_code=$?
echo_success $exit_code
return $exit_code
}
link() {
[ ! -z $3 ] && printf "link: too many arguments" && return 1
printf "[ link ] from $1 to $2... "
printf "\n\n\n[ link ] from $1 to $2\n" >> "$LOG"
printf "\n\n\n[ link ] from $1 to $2\n" >> "$ERR"
printf "sudo ln -sf $1 $2\n" >> "$LOG"
printf "sudo ln -sf $1 $2\n" >> "$ERR"
[ -f "$2" ] && echo $password | sudo -S mv $2 $2.bak >> "$LOG" 2>> "$ERR"
echo $password | sudo -S ln -sf $1 $2 >> "$LOG" 2>> "$ERR"
exit_code=$?
echo_success $exit_code
return $exit_code
}
pacman_enable_archlinuxcn(){ # add archlinuxcn to the pacman repositories
printf "[pacman] enable archlinuxcn"
printf "\n\n\n[pacman] enable archlinuxcn\n" >> "$LOG"
printf "\n\n\n[pacman] enable archlinuxcn\n" >> "$ERR"
grep "\[archlinuxcn\]" /etc/pacman.conf &> /dev/null || printf "\n\n[archlinuxcn]\nServer=https://repo.archlinuxcn.org/\$arch" | sudo tee -a /etc/pacman.conf > /dev/null 2>> "$ERR"
echo $password | sudo -S pacman -Syy >> "$LOG" 2>> "$ERR"
pacman_install archlinuxcn-keyring
}
pacman_enable_multilib(){
printf "[pacman] enable multilib"
printf "\n\n\n[pacman] enable multilib\n" >> "$LOG"
printf "\n\n\n[pacman] enable multilib\n" >> "$ERR"
sudo sed -i 's|^#\[multilib\]|[multilib]\nInclude\ =\ /etc/pacman.d/mirrorlist|g' /etc/pacman.conf >> "$LOG" 2>> "$ERR"
sudo sed -i 's|^#\[multilib-testing\]|[multilib-testing]\nInclude\ =\ /etc/pacman.d/mirrorlist|g' /etc/pacman.conf >> "$LOG" 2>> "$ERR"
echo $password | sudo -S pacman -Syy >> "$LOG" 2>> "$ERR"
}
# Linux kernels
#-------------------------------------------------------------------------------
## switch to bleeding edge linux kernel (this is what I use)
#pacman_install linux
## switch to long term support linux kernel
#pacman_install linux-lts
## switch to hardened (safer) linux kernel
#pacman_install linux-hardened
## switch to zen kernel
#pacman_install linux-zen
## always generate grub entries after installing new kernels:
#echo $password | sudo -S grub-mkconfig -o /boot/grub/grub.cfg
# Build tools
#-------------------------------------------------------------------------------
pacman_install make
pacman_install cmake
# Git
#-------------------------------------------------------------------------------
pacman_install git
pacman_install git-lfs
git config pull.rebase false
git config push.default simple
git config advice.addIgnoredFile false
git submodule update --init --recursive
# Alternative package managers
#-------------------------------------------------------------------------------
## yay (AUR helper)
git_install https://aur.archlinux.org/yay.git
## npm (node package manager)
pacman_install npm
#pip (python package manager)
#pacman_install python-pip
#pacman_install python2-pip
# Terminal: tools and TUIs
#-------------------------------------------------------------------------------
## eyecandy: patch pacman config to enable Color and ILoveCandy
echo $password | sudo -S sed -i 's|^#Color|Color\nILoveCandy|g' /etc/pacman.conf >> "$LOG" 2>> "$ERR"
## disable tty tickets (giving sudo password in one terminal enables passwordless sudo in other terminals as well for 15 min)
echo Defaults:$USER '!tty_tickets', timestamp_timeout=15 | sudo tee /etc/sudoers.d/tty_tickets
## install scripts for bootstrapping new arch installations
#pacman_install arch-install-scripts
## alacritty: arguably the best terminal
pacman_install alacritty
## calcurse: a terminal calendar client
#pacman_install calcurse
## vdirsyncer: synchronize caldav and carddav
#pacman_install vdirsyncer
## khal: calendar command line utility for caldav sync
#pacman_install khal
## search tool
pacman_install grep
## download tool
pacman_install curl
## alternative download tool (youtube-dl dependency)
pacman_install wget
## alternative search tool
#pacman_install ripgrep
## alternative search tool
#pacman_install ack
## fuzzy finder tool
pacman_install fzf
## rsync: safe and secure copy & backup
pacman_install rsync
## atool gives information about archives
#pacman_install atool
## glu: opengl binaries
pacman_install glu
## zip
pacman_install zip
## unzip
pacman_install unzip
## unrar
pacman_install unrar
## universal unarchiver (executable: unar)
pacman_install unarchiver
## rpm extraction shell script
#yay_install rpmextract
## pv: progress bars on stdout
#pacman_install pv
## battery information
#pacman_install acpi
## battery daemon (sleep on low power):
#pacman_install acpid
#systemctl_enable acpid
## vifm: terminal file browser
#pacman_install vifm
## dos2unix: tool to change carriage return (^M | \r) into nomal return (\n)
#pacman_install dos2unix
## terminal multiplexer:
pacman_install tmux
## run tmux as a systemd service:
systemctl_create tmux
systemctl_enable tmux
## program manuals
pacman_install man
pacman_install man-db
pacman_install man-pages
pacman_install texinfo
## very useful alternative to man: show most common commands for executable
pacman_install tldr
## unit conversions
#pacman_install units
## terminal music player: mplayer
#pacman_install mplayer
## copying and pasting from the terminal
pacman_install xclip
## pdf conversion
pacman_install poppler
## video to thumbnail conversion
pacman_install ffmpegthumbnailer
## audio thumbnails with ffmpeg (heh?)
#yay_install ffmpegthumbnailer-mp3
## epub thumbnailer
#yay_install epub-thumbnailer-git
## font previewer
#yay_install fontpreview-git
## check if bash script is posix complient (needs haskell -> 250mb -> disabled by default)
#pacman_install shellcheck
## shell formatter
#pacman_install shfmt
## highlight: to highlight code in the terminal (nice `cat` alternative, used in my custom scripts)
pacman_install highlight
## mediainfo: show audio and video information in terminal
#pacman_install mediainfo
## process information
pacman_install htop
## termdown: terminal timer/stopwatch
#pacman_install termdown
## espeak: text to speach engine (used in my custom termdown script)
#pacman_install espeak
## aplay: simple sound player based on alsa
#yay_install alsaplayer-git
## system information
pacman_install neofetch
## lightweight system information
#yay_install pfetch
## some more eye-candy (useless music visualizer):
#yay_install cli-visualizer-git
## large ascii letters
#pacman_install figlet
## task spooler: queue tasks
#pacman_install task-spooler
## netcat: for socket communication
#pacman_install gnu-netcat
## sockets (needed for custom mpvcontrol script)
pacman_install socat
## torrents: transmission cli
pacman_install transmission-cli
## transmission remote cli curses interface:
yay_install tremc-git
## transmission remote cli gtk interface
#pacman_install transmission-remote-gtk
## add current user to the transmission group:
echo $password | sudo -S usermod -a -G transmission $USER
## make the system transmission config writable by current user:
echo $password | sudo -S chmod -R g+rw /var/lib/transmission
## a more beautiful ls command (I have ls remapped to lsd when no arguments given)
pacman_install lsd
## vim / neovim: terminal text editor
pacman_install neovim
## link neovim to standard vim binary:
link /usr/bin/nvim /usr/bin/vim
link /usr/bin/nvim /usr/bin/vi
## pynvim: better integration of python with neovim:
pacman_install python-pynvim
## neovim-remote: some of my nvim scripts depend on it
yay_install neovim-remote
pacman_install python-pynvim
## packer: lua-based package manager for neovim
yay_install nvim-packer-git
## stylua: a lua formatter (like black for python)
pacman_install stylua
## ripgrep: better grep utility, also used by telescope-nvim plugin
pacman_install ripgrep
## fd: better find utility, also used by telescoe-nvim plugin
pacman_install fd
## ruby-neovim: better integration of ruby with neovim:
#yay_install ruby-neovim
## node-neovim: better integration of nodejs with neovim:
#npm_install neovim
## vimwiki-markdown: better integration for mardown files in vimwiki:
#pip3_install vimwiki-markdown
## instant-markdown-d used for instant markdown visualization in vim
#npm_install instant-markdown-d
## pyright: static typechecker and linter for python
npm_install pyright
## rust: best programming language out there
pacman_install rustup
## rust_analyzer: static typechecker and linter for rust
pacman_install rust-analyzer
## ccls: C language server (required by CoC plugin for nvim)
pacman_install ccls
## bash language server (required by CoC plugin for nvim)
pacman_install bash-language-server
## eslint: javascript linter (required by COC plugin for nvim)
pacman_install eslint
## ctags: recommended vim dependency for jump-to-tag functionality
pacman_install ctags
## tidy: html formatter
pacman_install tidy
## prettier: universal formatter
pacman_install prettier
## scim: terminal spreadsheet viewer/editor
#yay_install sc-im
## wordgrinder: terminal word processor
#yay_install wordgrinder
## terminal internet search: google
#yay_install googler
## terminal internet search: duckduckgo
#yay_install ddgr
## newsboat: RSS reader
#pacman_install newsboat
## ueberzug: image overlays in the terminal
pacman_install ueberzug
## trans: command line translation engine
#pacman_install translate-shell
## whois information
#pacman_install whois
## cronie: cron job daemon
#pacman_install cronie
## (pixelated) terminal image previews
yay_install viu
#systemctl_enable cronie
## ncmpcpp: terminal music client
#pacman_install ncmpcpp
## spotify-tui: terminal client for spotify (building this takes LONG)
#yay_install spotify-tui
## spotify daemon (dependency for spotify-tui)
#pacman_install spotifyd
## playerctl: terminal client to control spotify, spotifyd, vlc, ...
pacman_install playerctl
## media daemon
#pacman_install mpd
#systemctl_enable mpd
## media control
#pacman_install mpc
## service that checks number of packages that need updating:
systemctl_create pacmanquery
systemctl_enable pacmanquery
## Docker
pacman_install docker
pacman_install docker-buildx
curl -L https://raw.githubusercontent.com/docker/compose-cli/main/scripts/install/install_linux.sh | sh
sudo ln -sf /usr/local/bin/docker /usr/bin/docker
systemctl_enable docker
# Drive and file system drivers
#-------------------------------------------------------------------------------
## mount cifs parititions
pacman_install cifs-utils
## dosfstools: support for dos (windows) - like filesystems
pacman_install dosfstools
## exfat-utils: access fat-drives
pacman_install exfat-utils
## ntfs-3g: access NTFS network drives
pacman_install ntfs-3g
## samba shares = network volumes
pacman_install samba
## access media on external device (phone, ...)
pacman_install libmtp
pacman_install fuse
pacman_install android-file-transfer # android access
## access ssh file system
pacman_install sshfs
## access mac-formatted drives (HFS+)
# yay_install hfsprogs
## testdisk to figure out location HFS+ partition wrapped in 'Apple Core Storage':
pacman_install testdisk
## data-at-rest tool: easy-to-use stacked filesystem encryption tool
pacman_install gocryptfs
## webdav filesystem (mount Nextcloud as a folder)
yay_install davfs2
## recommended settings for davfs2 + Nextcloud
echo $password | sudo -S sed -i 's/# use_locks.*/use_locks 0/g' /etc/davfs2/davfs2.conf
# Graphical desktop server: xorg
#-------------------------------------------------------------------------------
## install everything from xorg:
#pacman_install xorg
## install just the graphical server
pacman_install xorg-server
## install the xorg server development packages
#pacman_install xorg-server-devel
## initializing (for starting the window manager without display manager)
pacman_install xorg-xinit
## querying window information
#pacman_install xorg-xwininfo
## tool for detecting window properties
pacman_install xorg-xprop
## tool for showing x event names
pacman_install xorg-xev
## get info on current active windows
#pacman_install xorg-xdpyinfo
## special libinput fork to enable three finger dragging
#yay_install libinput-three-finger-drag
## enable tap-to-click on some touchpads (probably a manual install works better):
# grep 'Option "Tapping" "on"' /usr/share/X11/xorg.conf.d/40-libinput.conf &> /dev/null || echo $password | sudo -S sed -i 's|^\([^M]*\)\(MatchIsTouchpad.*\)|\1\2\n\1Option "Tapping" "on"|g' /usr/share/X11/xorg.conf.d/40-libinput.conf
## virtual x server
pacman_install xorg-server-xvfb
## hide an inactive mouse
pacman_install unclutter
## dependency for my st fork to find urls in terminal:
yay_install xurls
## remap escape key:
#yay_install xcape-git
## emulate mouse clicks and keyboard presses
pacman_install xdotool
## emulate mouse clicks and more from within python
yay_install python-pyautogui
## xsettingsd: immediately apply changes in GTK theme
pacman_install xsettingsd
## server access control for x
pacman_install xorg-xhost
## sharing and viewing x-sessions on other computers
#pacman_install x11vnc
## create x11vnc systemd service:
#systemctl_create x11vnc
## view x11vnc session (executable: gvncviewer)
#pacman_install gtk-vnc
## view x11vnc session (executable: vncviewer) <-- better framerate
#pacman_install tigervnc
## view x11vnc and realvnc sessions (executable: vncviewer)
#yay_install realvnc-vnc-viewer
## compositor (for transparent windows, blur, ...)
#pacman_install xcompmgr
## better compositor:
pacman_install picom
## bleeding edge version of picom:
#yay_install picom-git
## libxft-bgra; alternative to libxft, helper library for color emojis in my st build:
## the reason it is installed this way is because this library replaces libxft
## requiring you to answer yes on a [y/N] question...
pacman -Q libxft-bgra-git &> /dev/null || yes | LC_ALL=en_US.UTF-8 yay -S -q libxft-bgra-git >> "$LOG" 2>> "$ERR"
## Dell displaylink drivers:
#pacman_install linux-headers
#yay_install evdi-git
#yay_install evdi
#yay_install displaylink
#yay_install displaylink-beta
#systemctl_enable displaylink
#printf "Section \"OutputClass\"\n Identifier \"DisplayLink\"\n MatchDriver \"evdi\"\n Driver \"modesetting\"\n Option \"AccelMethod\" \"none\"\nEndSection" | sudo tee /usr/share/X11/xorg.conf.d/20-evdidevice.conf > /dev/null 2>> "$ERR"
#printf "Section \"Device\"\n Identifier \"DisplayLink\"\n Driver \"modesetting\"\n Option \"PageFlip\" \"false\"\nEndSection" | sudo tee /usr/share/X11/xorg.conf.d/21-displaylink.conf > /dev/null 2>> "$ERR"
#yay_install rsyslog
#printf ":msg,contains,"drm_wait_vblank" /var/log/displaylink.err\n&stop" | sudo tee /etc/rsyslog.d/30-displaylink.conf > /dev/null 2>> "$ERR"
#systemctl_enable rsyslog
# Desktop Environment / Window Manager
#-------------------------------------------------------------------------------
## i3lock: screen lock for i3 and other window managers like in this case dwm.
pacman_install i3lock
## xsetroot: for status bar in dwm
pacman_install xorg-xsetroot
## sxhkd: keyboard shortcuts daemon
pacman_install sxhkd
## light: CLI utility to change backlight value of laptops
pacman_install light
## allow only users in video group to make changes to backlight
groupadd video >> "$LOG" 2>> "$ERR"
echo $password | sudo -S usermod -a -G video $USER
echo "ACTION==\"add\", SUBSYSTEM==\"backlight\", KERNEL==\"intel_backlight\", RUN+=\"/bin/chgrp video /sys/class/backlight/%k/brightness\"" | sudo tee /etc/udev/rules.d/backlight.rules > /dev/null 2>> "$ERR"
echo "ACTION==\"add\", SUBSYSTEM==\"backlight\", KERNEL==\"intel_backlight\", RUN+=\"/bin/chmod g+w /sys/class/backlight/%k/brightness\"" | sudo tee -a /etc/udev/rules.d/backlight.rules > /dev/null 2>> "$ERR"
## xautolock to automatically lock the screen
pacman_install xautolock
## wallpapers
pacman_install feh
## moving wallpapers
#git clone https://github.com/glouw/paperview /tmp/paperview >"$LOG" 2>"$ERR"; cd /tmp/paperview >"$LOG" 2>"$ERR"; make >"$LOG" 2>"$ERR"; mv paperview ~/.local/bin >"$LOG" 2>"$ERR"; mv scenes ~/.local/share >"$LOG" 2>"$ERR"; cd ~; rm -rf /tmp/paperview
## dependency for moving wallpapers
#pacman_install sdl2
## rofi (dmenu alternative)
#pacman_install rofi
## albert (dmenu alternative)
#pacman_install albert
## xmenu (application launcher)
#yay_install xmenu
## conky: a system monitor
#pacman_install conky
## display manager
pacman_install lightdm
##pacman_install lightdm-gtk-greeter
##yay_install lightdm-slick-greeter
yay_install lightdm-mini-greeter
echo $password | sudo -S mkdir -p /usr/share/xsessions
echo $password | sudo -S cp -f $HOME/.local/share/applications/dwm.desktop /usr/share/xsessions/
echo $password | sudo -S sed -i "s/\(#\)\?.*greeter-session.*=.*/greeter-session=lightdm-mini-greeter/g" /etc/lightdm/lightdm.conf >> "$LOG" 2>> "$ERR"
echo $password | sudo -S sed -i "s/\(#\)\?.*user-session.*=.*/user-session=dwm/g" /etc/lightdm/lightdm.conf >> "$LOG" 2>> "$ERR"
echo $password | sudo -S sed -i "s/^user.*=.*/user = $USER/g" /etc/lightdm/lightdm-mini-greeter.conf >> "$LOG" 2>> "$ERR"
echo $password | sudo -S sed -i "s/^show-password-label.*=.*/show-password-label = false/g" /etc/lightdm/lightdm-mini-greeter.conf >> "$LOG" 2>> "$ERR"
echo $password | sudo -S sed -i "s/^password-label-text.*=.*/password-label-text = $USER:/g" /etc/lightdm/lightdm-mini-greeter.conf >> "$LOG" 2>> "$ERR"
echo $password | sudo -S sed -i "s|^background-image.*=.*|background-image=\"$HOME/.cache/current-wallpaper\"|g" /etc/lightdm/lightdm-mini-greeter.conf >> "$LOG" 2>> "$ERR"
echo $password | sudo -S sed -i "s/F92672/2AA198/g" /etc/lightdm/lightdm-mini-greeter.conf >> "$LOG" 2>> "$ERR"
systemctl_enable lightdm
## maybe you just want autologin instead of a display manager:
#systemctl_create getty-auto-login
# Desktop notifications
#-------------------------------------------------------------------------------
## libnotify allows desktop notifications
pacman_install libnotify
## dunst creates desktop notifications
pacman_install dunst
# Windows compatibility & gaming
#-------------------------------------------------------------------------------
## patch pacman settings to include multilib
#pacman_enable_multilib
## wine-staging (better version of wine):
#pacman_install wine-staging
## wine (worse vorsion of wine)
#pacman_install wine
## winetricks: install dependencies and so on
#pacman_install winetricks
## gecko driver for wine (for programs relying on IE)
#pacman_install wine-gecko
## mono driver for wine
#pacman_install wine-mono
## better game support on linux
#pacman_install lutris
## steam game store
#pacman_install steam
## vulkan drivers
#pacman_install vulkan-intel
## playonlinux programs
#pacman_install playonlinux
## potentially useful audio drivers
#pacman_install alsa-plugins
#pacman_install lib32-alsa-plugins
#pacman_install alsa-lib
#pacman_install lib32-alsa-lib
#pacman_install libpulse
#pacman_install lib32-libpulse
## other potentially useful drivers:
#pacman_install mpg123
#pacman_install lib32-mpg123
#pacman_install giflib
#pacman_install lib32-giflib
#pacman_install libpng
#pacman_install lib32-libpng
#pacman_install gnutls
#pacman_install lib32-gnutls
#pacman_install gst-plugins-base
#pacman_install lib32-gst-plugins-base
#pacman_install gst-plugins-good
#pacman_install lib32-gst-plugins-good
#pacman_install openal
#pacman_install lib32-openal
#pacman_install libgl
#pacman_install lib32-libgl
## if you're using the nvidia driver:
#pacman_install nvidia-utils
#pacman_install lib32-nvidia-utils
# Sound
#-------------------------------------------------------------------------------
## alsamixer
pacman_install alsa-utils
## other alsa plugins
pacman_install alsa-plugins
## pulse audio
pacman_install pulseaudio
# Connectivity and network
#-------------------------------------------------------------------------------
## network manager
pacman_install networkmanager
systemctl_enable NetworkManager
## use cloudflare DNS servers:
printf "[global-dns-domain-*]\nservers=1.1.1.1,1.0.0.1" | sudo tee /etc/NetworkManager/conf.d/dns-servers.conf > /dev/null 2>> "$ERR"
## create network group (this might fail if the group exists already, but who cares.)
groupadd network >> "$LOG" 2>> "$ERR"
## create policy kit rule (everyone in network group can connect to / change networks)
printf "polkit.addRule(function(action, subject) {\n if (action.id.indexOf(\"org.freedesktop.NetworkManager.\") == 0 && subject.isInGroup(\"network\")) {\n return polkit.Result.YES;\n }\n});" | sudo tee /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules > /dev/null 2>> "$ERR"
## add current user to network group
echo $password | sudo -S usermod -a -G network $USER
## applet in the corner of the screen
pacman_install network-manager-applet
## vpn: openconnect (cisco anyconnect)
pacman_install openconnect
## vpn: openvpn
pacman_install openvpn
## openvpn plugin for networkmanager
pacman_install networkmanager-openvpn
## openvpn service that can be run in the background
systemctl_create openvpn
#systemctl_enable openvpn
## ssh (client and server)
pacman_install openssh
## ssl
pacman_install openssl
## ssl 1.1
pacman_install openssl-1.1
## mosh (ssh client for connections with high latency)
pacman_install mosh
## allow X-forwarding for sshd:
echo $password | sudo -S sed -i 's|^.*X11Forwarding.*|X11Forwarding yes|g' /etc/ssh/sshd_config >> "$LOG" 2>> "$ERR"
systemctl_enable sshd
## autossh (for ssh daemons)
pacman_install autossh
## access to google servers
#yay_install google-cloud-sdk
## bluetooth
pacman_install bluez
pacman_install bluez-utils
pacman_install pulseaudio-bluetooth
## enable bluetooth service
systemctl_enable bluetooth
## remote desktop
pacman_install remmina
## add windows remote desktop protocol to remmina
pacman_install freerdp
## barrier: seemless mouse and keyboard sharing between computers (takes a while to build)
pacman_install barrier
pacman_install barrier-headless
# Themes
#-------------------------------------------------------------------------------
## gtk3
pacman_install gtk3
## adwaita [inkscape dependency]
pacman_install gnome-themes-standard
## murrine theme [inkscape dependency]
pacman_install gtk-engine-murrine
## adapta theme
pacman_install adapta-gtk-theme
## arc theme
pacman_install arc-gtk-theme
## dark gruvbox-inspired arc theme (default theme for now)
yay_install gtk-theme-arc-gruvbox-git
## dark nord-inspired color theme
yay_install nordic-theme-git
## light nord-inspired color theme
#yay_install nordic-polar-theme-git
## lxappearance: tool to choose gtk themes
pacman_install lxappearance
## gtk look-and-feel for qt (comes with kvantummanager = lxappearance for qt apps):
pacman_install kvantum-qt5
## needed to enable kvantum:
pacman_install qt5ct
## nord color theme for kvantum:
yay_install kvantum-theme-nordic-git
## manjaro cursor theme
#yay_install xcursor-menda-git
#yay_install xcursor-maia-git
## red-had cursor theme
#pacman_install xcursor-bluecurve
## comix cursor theme
#pacman_install xcursor-comix
## flatbed cursor theme
#pacman_install xcursor-flatbed
## neutral cursor theme
#pacman_install xcursor-neutral
## simple and soft cursor theme
yay_install xcursor-simpleandsoft
# Web and web interfaces
#-------------------------------------------------------------------------------
## syncthing: synchronization between devices
#pacman_install syncthing
## run syncthing as a systemd service
systemctl_create syncthing
#systemctl_enable syncthing
## jellyfin: media center
#yay_install jellyfin
#systemctl_enable jellyfin
## nextcloud: your own dropbox at home :-)
#pacman_install nextcloud-client
## libgnome-keyring: necessary dependency for nextcloud client so it can remember your password
#pacman_install libgnome-keyring
## override the default general nextcloud settings
#[ -f $HOME/.config/Nextcloud/nextcloud.cfg ] || cp $HOME/.config/Nextcloud/nextcloud.general.cfg $HOME/.config/Nextcloud/nextcloud.cfg
## nextcloud server (this needs quite a bit of manual configuration):
#pacman_install nextcloud
## nginx: reverse proxy
pacman_install nginx
echo $password | sudo -S mkdir -p /var/www/html
## patch nginx to increase types hash
grep types_hash_max_size /etc/nginx/nginx.conf &> /dev/null
[ $? -ne 0 ] && echo $password | sudo -S sed -i 's|http {.*|http {types_hash_max_size 4096;|g' /etc/nginx/nginx.conf
## patch nginx to look into /var/www/html by default
echo $password | sudo -S sed -i 's|root.*/usr/share/nginx/html;|root /var/www/html;|g' /etc/nginx/nginx.conf
echo $password | sudo -S cp /usr/share/nginx/html/50x.html /var/www/html/
if [ -f "$HOME/.extra/index.html" ]; then
[ -f /var/www/html/index.html ] || echo $password | sudo -S cp $HOME/.extra/index.html /var/www/html/index.html
else
[ -f /var/www/html/index.html ] || echo $password | sudo -S cp /usr/share/nginx/html/index.html /var/www/html/
fi
systemctl_enable nginx
# Printers
#-------------------------------------------------------------------------------
## printer system (cups @ localhost:631)
pacman_install cups
## common printer drivers
pacman_install gutenprint
## for network printing
pacman_install avahi
pacman_install nss-mdns
systemctl_enable avahi-daemon
## print to pdf
pacman_install cups-pdf
## enable cups service
systemctl_enable cups
# Fonts
#-------------------------------------------------------------------------------
# note: I block MANY fonts in ~/.config/fontconfig/conf.d/ I do this to have
# better control over which fonts are used on my system. However, this
# means that installing a font might not automatically make it available.
# You might need to remove the fontconfig block.
## fontconfig should already be installed, but just to be sure:
pacman_install fontconfig
## dejavu font: inkscape dependency (fully blocked by my fontconfig, replaced by Bitstream Vera):
pacman_install ttf-dejavu
## bitstream vera: alternative to dejavu (not blocked by my fontconfig, replaces DejaVu):
pacman_install ttf-bitstream-vera
## cantarell fonts: gtk3 dependency (fully blocked by my fontconfig):
pacman_install cantarell-fonts
## adobe fonts: nemo and other GNOME apps dependency (fully blocked by my fontconfig):
pacman_install adobe-source-code-pro-fonts