-
Notifications
You must be signed in to change notification settings - Fork 1
/
ai-pkgs
executable file
·2630 lines (2270 loc) · 111 KB
/
ai-pkgs
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
source "${0%/*}/ai-funcs"
declare -r TITLEBAR="AI PACKAGE SELECTION"
declare -i DLG_HIGH DLG_WIDE LST_HIGH
declare -A INTENTS PACKAGES
declare -a BROWSERS_BLINK BROWSERS_GECKO BROWSERS_WBKT2GTK BROWSERS_QTWEBKIT
################################################################################
# Overly-cautious verification of required binaries
################################################################################
for CMD in curl date nmap pacman pacstrap stat xargs; do
BIN["${CMD}"]="$(GET_COMMAND "${CMD}")" || ERR_LIST+="CRIT: Couldn't find ${CMD}\n"
done
# Some versions of Arch do not have reflector
if "${BIN[pacman]}" -Si reflector > /dev/null 2>&1; then
BIN[reflector]="$(GET_COMMAND reflector)" || ERR_LIST+="CRIT: Couldn't find reflector\n"
fi
FILE[pci.ids]="$("${BIN[find]}" /usr/share -name 'pci.ids' 2> /dev/null)"
[[ -z ${FILE[pci.ids]} ]] && ERR_LIST+="CRIT: Couldn't find pci.ids under /usr/share\n"
################################################################################
# At this point, we can tell the user about all the fail points.
################################################################################
CHECK_FOR_FAILURE_POINTS
function ARE_ONE_OF_THESE_SELECTED {
local SELECTED=false
for PACKAGE in ${1}; do
[[ ${PACKAGES[*]} =~ ' '${PACKAGE}' ' ]] && echo "${PACKAGE}" && SELECTED=true
done
${SELECTED}
}
function CLEAN_PACKAGE_GROUP {
local BAN_LIST LET_LIST
# This function is used to remove package options from package
# groups that the script will specifically handle later.
#
# The commented-out 'candidates' are just notes for the case where we might
# consider handling extra application categories in the future. It would be
# be a giant PITA, so for now we just we just block the following:
#
# web browsers
# display managers
# email clients
# gvfs
# thumbnailers
# andontie-aur and chaotic-aur additions to groups that may be forced
#
# All of those categories are handled independently by this script.
BAN_LIST+='chrome-gnome-shell epiphany gdm totem ' # gnome:general
BAN_LIST+='gvfs gvfs-afc gvfs-goa gvfs-google gvfs-mtp gvfs-nfs gvfs-smb ' # gnome:gvfs
#BAN_LIST+='evince gedit gnome-calculator gnome-photos gnome-terminal totem ' # gnome:candidates
BAN_LIST+='evolution geary ' # gnome-extra
BAN_LIST+='deepin-movie ' # deepin-extra
#BAN_LIST+='deepin-album deepin-calculator deepin-compressor deepin-editor deepin-music deepin-reader deepin-terminal '
BAN_LIST+='dragon ffmpegthumbs ' # kde-multimedia
BAN_LIST+='kate ' # kde-utilities
BAN_LIST+='kmail kmail-account-wizard ' # kdepim
BAN_LIST+='lxdm ' # lxde
#BAN_LIST+='pcmanfm pcmanfm-gtk3' # lxde:candidates
#BAN_LIST+='lxqt-archiver pcmanfm-qt' # lxqt:candidates
#BAN_LIST+='caja ' # mate:candidates
#BAN_LIST+='caja-image-converter caja-open-terminal caja-sendto caja-share caja-wallpaper caja-xattr-tags '
#BAN_LIST+='engrampa eom mate-calc mate-terminal pluma ' # mate-extra:candidates
BAN_LIST+='maui-clip ' # maui
BAN_LIST+='pantheon-videos ' # pantheon
BAN_LIST+='discover-snap grub2-editor-frameworks plasma-nm sddm-kcm ' # plasma
BAN_LIST+='tumbler xfce4-panel-compiz ' # xfce4
#BAN_LIST+='thunar thunar-volman xfce-terminal ' # xfce4:candidates
BAN_LIST+='parole ' # xfce4-goodies
#BAN_LIST+='mousepad ristretto thunar-archive-plugin thunar-media-tags-plugin' # xfce4-goodies:candidates
for MEMBER in $(${BIN[pacman]} -Sgq "${1}" | ${BIN[tr]} '\n' ' '); do
[[ "${BAN_LIST}" =~ ' '${MEMBER}' ' ]] || LET_LIST+="${MEMBER} "
done
echo "${LET_LIST% }"
}
function GET_BROWSERS {
local -i TTLSTEPS=33 CURSTEP
local BAKTITLE='Discovering browsers...'
if [[ ${BIN[dialog]} =~ /dialog ]]; then
local MAIN_TTL="${BAKTITLE^^}"
local BACK_TTL="${TITLEBAR^^}"
local DLG_HIGH=6
elif [[ ${BIN[dialog]} =~ Xdialog ]]; then
local MAIN_TTL="${TITLEBAR}"
local BACK_TTL="${BAKTITLE}"
local DLG_HIGH=9
fi
while true; do
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Brave"
IS_REPO_PKG 'brave' && BROWSERS_BLINK+=('brave:Brave')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
[[ ! ${BROWSERS_BLINK[*]} =~ Brave ]] && IS_REPO_PKG 'brave-bin' && BROWSERS_BLINK+=('brave-bin:Brave')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Chromium"
BROWSERS_BLINK+=('chromium:Chromium')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Chrome"
IS_REPO_PKG 'google-chrome' && BROWSERS_BLINK+=('google-chrome:Chrome')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Edge"
IS_REPO_PKG 'microsoft-edge' && BROWSERS_BLINK+=('microsoft-edge:Edge')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
[[ ! ${BROWSERS_BLINK[*]} =~ Edge ]] && IS_REPO_PKG 'microsoft-edge-beta' && BROWSERS_BLINK+=('microsoft-edge-beta:Edge')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
[[ ! ${BROWSERS_BLINK[*]} =~ Edge ]] && IS_REPO_PKG 'microsoft-edge-beta-bin' && BROWSERS_BLINK+=('microsoft-edge-beta-bin:Edge')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Opera"
BROWSERS_BLINK+=('opera:Opera')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Ungoogled Chromium"
IS_REPO_PKG 'ungoogled-chromium' && BROWSERS_BLINK+=('ungoogled-chromium:Ungoogled_Chromium')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Vivaldi"
BROWSERS_BLINK+=('vivaldi:Vivaldi')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Yandex"
IS_REPO_PKG 'yandex-browser' && BROWSERS_BLINK+=('yandex-browser:Yandex.Browser')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
[[ ! ${BROWSERS_BLINK[*]} =~ Yandex ]] && IS_REPO_PKG 'yandex-browser-beta' && BROWSERS_BLINK+=('yandex-browser-beta:Yandex.Browser')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Firefox"
BROWSERS_GECKO+=('firefox:Firefox')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Firefox ESR"
IS_REPO_PKG 'firefox-esr' && BROWSERS_GECKO+=('firefox-esr:Firefox_ESR')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
[[ ! ${BROWSERS_GECKO[*]} =~ 'Firefox ESR' ]] && IS_REPO_PKG 'firefox-esr-bin' && BROWSERS_GECKO+=('firefox-esr-bin:Firefox_ESR')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Firedragon"
IS_REPO_PKG 'firedragon' && BROWSERS_GECKO+=('firedragon:Firedragon')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Icecat"
IS_REPO_PKG 'icecat' && BROWSERS_GECKO+=('icecat:Icecat')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Librewolf"
IS_REPO_PKG 'librewolf' && BROWSERS_GECKO+=('librewolf:Librewolf')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Palemoon"
IS_REPO_PKG 'palemoon' && BROWSERS_GECKO+=('palemoon:Palemoon')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
[[ ! ${BROWSERS_GECKO[*]} =~ Palemoon ]] && IS_REPO_PKG 'palemoon-bin' && BROWSERS_GECKO+=('palemoon-bin:Palemoon')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
[[ ! ${BROWSERS_GECKO[*]} =~ Palemoon ]] && IS_REPO_PKG 'palemoon-gtk3-bin' && BROWSERS_GECKO+=('palemoon-gtk3-bin:Palemoon')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Seamonkey"
BROWSERS_GECKO+=('seamonkey:Seamonkey')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Waterfox"
IS_REPO_PKG 'waterfox' && BROWSERS_GECKO+=('waterfox:Waterfox')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
[[ ! ${BROWSERS_GECKO[*]} =~ Palemoon ]] && IS_REPO_PKG 'waterfox-bin' && BROWSERS_GECKO+=('waterfox-bin:Waterfox')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
[[ ! ${BROWSERS_GECKO[*]} =~ Palemoon ]] && IS_REPO_PKG 'waterfox-g3-bin' && BROWSERS_GECKO+=('waterfox-g3-bin:Waterfox')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Eolie"
BROWSERS_WBKT2GTK+=('eolie:Eolie')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "GNOME Web"
BROWSERS_WBKT2GTK+=('epiphany:GNOME Web')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Badwolf"
IS_REPO_PKG 'badwolf' && BROWSERS_WBKT2GTK+=('badwolf:Badwolf')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Lariza"
IS_REPO_PKG 'lariza' && BROWSERS_WBKT2GTK+=('lariza:Lariza')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Netsurf"
BROWSERS_WBKT2GTK+=('netsurf:Netsurf')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Falkon"
BROWSERS_QTWEBKIT+=('falkon:Falkon')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "Otter Browser"
IS_REPO_PKG 'otter-browser' && BROWSERS_QTWEBKIT+=('otter-browser:Otter Browser')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
"${BIN[printf]}" 'XXX\nLooking for %s...\nXXX\n' "QuteBrowser"
IS_REPO_PKG 'qutebrowser' && BROWSERS_QTWEBKIT+=('qutebrowser:Qutebrowser')
((CURSTEP++)); echo "$((CURSTEP*100/TTLSTEPS))"
break
done > >("${BIN[dialog]}" --title "${MAIN_TTL}" --backtitle "${BACK_TTL}" --guage '' "${DLG_HIGH}" 72)
}
function GET_GPU_TYPE_AMD {
case "${1}" in
# The architecture of the earliest ATI cards is not known
# We use ATI0 to denote proprietary 2D-only cards
# The earliest Wonder and Mach cards are ISA and won't show up
*Mach64*|*'Mach 64'*) echo 'ati0';;
# ATI1 and ATI2 denote proprietary fixed-pipeline 3D cards
# ATI1 uses the rage/r128 drivers while ATI2 uses the r100 drivers
*'3D Rage'*|*'Rage 128'*) echo 'ati1';;
*RS[12]00*) echo 'ati2';; # 300
*R100*|*RV100*) echo 'ati2';; # 7000
# ATI3 denoted proprietary 3D cards with some programmability
*R200*|*RV200*) echo 'ati3';; # 8000
*RV2[58]0*|*R3[05]0*|*RS3[05]0*|*RV350*) echo 'ati4:vd:';; # 9000
*R360*|*RV3[678]0*|*RV410*) echo 'ati5:vd:va:';; # X[356]00
*R42[03]*|*R48[01]*|*RV420*|RS4[018][02]*) echo 'ati5:vd:va:';; # X800
*R520*|*R580*|*RV5[013567][056]*|*R690*) echo 'ati5:vd:va:';; # X1000
*RS600*|*RS7[48]0*) echo 'ati5:vd:va:';; # HD 2000
# This is where AMD buys out ATI and is more open about architecture
*R600*|*RV610*|*RV630*) echo 'ts1:vd:va:';; # HD 2000
*RV620*|*RV635*|*RV6[78]0*) echo 'ts1:vd:va:';; # HD 3000
*RS780*) echo 'ts1:vd:va:';; # HD 3000
*R700*|*RS740*|*RV7[13479]0*|*RS880*) echo 'ts1:vd:va:';; # HD 4000
*Cedar*|*Cypress*|*Hemlock*|*Juniper*|*Redwood*) echo 'ts2:vd:va:';; # HD 5000
*Broadway*|*Madison*|*Park*) echo 'ts2:vd:va:';; # HD 5000
*Barts*|*Caicos*|*Turks*) echo 'ts2:vd:va:';; # HD 6000
*Blackcomb*|*Granville*|*Lexington*|*Pinewood*) echo 'ts2:vd:va:';; # HD 6000
*Robson*|*Seymour*|*Whistler*|*'HD 65'[357]0*) echo 'ts2:vd:va';; # HD 6000
*Sumo*|*Wrestler*|*'HD 62'[59]0*) echo 'ts2:vd:va:';; # HD 6000
*Onega*|*Thames*) echo 'ts2:vd:va:';; # HD 7000
*Antilles*|*Cayman*) echo 'ts3:vd:va:';; # HD 6000
*Richland*|*Trinity*) echo 'ts3:vd:va:';; # HD 8000
*'Cape Verde'*|*Pitcairn*|*Tahiti*) echo 'gcn1:vd:va:vk:';; # HD 7000
*Chelsea*|*Heathrow*|*Wimbledon*) echo 'gcn1:vd:va:vk:';; # HD 7000
*Malta*|*Mars*|*Neptune*|*Oland*|*Sun*|*Venus*) echo 'gcn1:vd:va:vk:';; # HD 8000
*'R7 250'*|*'R9 270'*|*Jet*|*Opal*|*Topaz*) echo 'gcn1:vd:va:vk:';; # Rx 200
*Curacao*|*Kryptos*|*Meso*) echo 'gcn1:vd:va:vk:';; # Rx 300
*Bonaire*) echo 'gcn2:vd:va:vk:cl:';; # HD 7000
*Kabini*|*Tamesh*) echo 'gcn2:vd:va:vk:cl:';; # HD 8000
*Kaveri*|*Mullins*|*Vesuvius*) echo 'gcn2:vd:va:vk:cl:';; # Rx 200
*Hawaii*|*Tobago*) echo 'gcn2:vd:va:vk:cl:';; # Rx 300
*Tonga*|*Amethyst*) echo 'gcn3:vd:va:vk:cl:';; # Rx 200
*Fiji*|*Stoney*|*Wani*) echo 'gcn3:vd:va:vk:cl:';; # Rx 300
*Baffin*|*Ellesmere*) echo 'gcn4:vd:va:vk:cl:';; # RX [45]00
*Lexa*|*'RX 5'[89]0*|*RX5[89]0*) echo 'gcn4:vd:va:vk:cl:';; # RX 500
*'Polaris '[12][012]*|*'Polaris 30'*) echo 'gcn4:vd:va:vk:cl:';; # RX 500
*'Vega 1'[02]*|*'Vega 20'*|*'Raven Ridge'*) echo 'gcn5:vd:va:vk:cl:';; # RX Vega
*'Radeon 5700 XT'*|*'Navi 1'[04]*) echo 'rdna1:vd:va:vk:cl:';; # RX 5000
*'Navi 2'[123]*) echo 'rdna2:vd:va:vk:cl:';; # RX 6000
# Attempt to future-proof by categorizing "Navi nn" as RDNA2
*'Navi '[0-9][0-9]*) echo 'rdna2';;
esac
}
function GET_CPU_TYPE_INTEL {
case "${1}" in
7800) echo 'igen1a';;
1240) echo 'igen1p';;
712[135]) echo 'igen1w';;
1132) echo 'igen1s';;
2562) echo 'igen2b';;
3577) echo 'igen2a';;
2572) echo 'igen2s';;
358[E2]) echo 'igen2m';;
258[2A]) echo 'igen3g';;
2592) echo 'igen3a';;
2772) echo 'igen3l';;
27A[2E]) echo 'igen3c';;
29[BCD]2) echo 'igen3b';;
A0[01]1) echo 'igen3p';;
2A[01]2) echo 'igen4cl';;
2972) echo 'igen4lp';;
2992) echo 'igen4bw';;
29A2) echo 'igen4bx';;
2982) echo 'igen4bl';;
2E[12349]2) echo 'igen4el:va:';;
2E02|2A42) echo 'igen4ct:va:';;
004[26]) echo 'igen5:va:';;
010[26a]) echo 'igen6s2:va:';;
01[12][26]) echo 'igen6s3:va:';;
015A) echo 'igen7i0:va:cl:vk:';; #HD
015[26]) echo 'igen7i2:va:cl:vk:';; #HD2500
016[26A]) echo 'igen7i4:va:cl:vk:';; #HD4000
0F3[0123]|015[57]) echo 'igen7b0:va:cl:vk:';;
0[4ACD]0[26ABE]) echo 'igen7h0:va:cl:vk:';; #HD
0A1E) echo 'igen7h2:va:cl:vk:';; #HD4200
041E|0A16) echo 'igen7h4:va:cl:vk:';; #HD4400
041[26AB]|0A1[2AB]) echo 'igen7h6:va:cl:vk:';; #HD4600
0[CD]1[26ABE]) echo 'igen7h6:va:cl:vk:';; #HD4600
0A2E) echo 'igen7hi:va:cl:vk:';; #I5100
0D2[26]) echo 'igen7hj:va:cl:vk:';; #IP5200
0[4C]2[26ABE]) echo 'igen7h9:va:cl:vk:';; #HD5000
0A2[26AB]|0D2[ABE]) echo 'igen7h9:va:cl:vk:';; #HD5000
22B[023]) echo 'igen8c0:va:cl:vk:';; #HD
22B1) echo 'igen8c4:va:cl:vk:';; #HD400
160[26ABDE]) echo 'igen8b0:va:cl:vk:';; #HD
161[BD]|162[DE]) echo 'igen8b0:va:cl:vk:';; #HD
161E) echo 'igen8b3:va:cl:vk:';; #HD5300
1616) echo 'igen8b5:va:cl:vk:';; #HD5500
1612) echo 'igen8b6:va:cl:vk:';; #HD5600
161A) echo 'igen8b7:va:cl:vk:';; #HD5700
1626) echo 'igen8b9:va:cl:vk:';; #HD6000
162B) echo 'igen8bi:va:cl:vk:';; #I6100
1622) echo 'igen8bj:va:cl:vk:';; #IP6200
162A) echo 'igen8bk:va:cl:vk:';; #IP6300
[01]A8[45]) echo 'igen9a0:va:cl:vk:';; #HD
5A85) echo 'igen9a1:va:cl:vk:';; #HD500
5A84) echo 'igen9a2:va:cl:vk:';; #HD505
190[AE]) echo 'igen9s0:va:cl:vk:';; #HD
190[26]B) echo 'igen9s1:va:cl:vk:';; #HD510
191E) echo 'igen9s2:va:cl:vk:';; #HD515
1916) echo 'igen9s3:va:cl:vk:';; #HD520
191[2BD]) echo 'igen9s4:va:cl:vk:';; #HD530
1926) echo 'igen9si:va:cl:vk:';; #I540
1927) echo 'igen9sj:va:cl:vk:';; #I550
192D) echo 'igen9sk:va:cl:vk:';; #I555
193[2ABD]) echo 'igen9sl:va:cl:vk:';; #IP580
3185) echo 'igen9gu:va:cl:vk:';; #UHD600
3184) echo 'igen9gv:va:cl:vk:';; #UHD605
590[8AE]) echo 'igen9k0:va:cl:vk:';; #HD
591[35]|593B) echo 'igen9k0:va:cl:vk:';; #HD
590[26]) echo 'igen9k1:va:cl:vk:';; #HD610
591E) echo 'igen9k2:va:cl:vk:';; #HD615
5916) echo 'igen9k3:va:cl:vk:';; #HD620
591[2B]) echo 'igen9k4:va:cl:vk:';; #HD630
5923) echo 'igen9k5:va:cl:vk:';; #HD635
591C) echo 'igen9ku:va:cl:vk:';; #UHD615
87C0) echo 'igen9kv:va:cl:vk:';; #UHD617
5917) echo 'igen9kw:va:cl:vk:';; #UHD620
5926) echo 'igen9ki:va:cl:vk:';; #IP640
5927) echo 'igen9kj:va:cl:vk:';; #IP650
3EA7) echo 'igen9c0:va:cl:vk:';; #HD
87CA|9B[AC][024ABC]) echo 'igen9cu:va:cl:vk:';; #UHD
3EA[234]|9B[24]1) echo 'igen9cu:va:cl:vk:';; #UHD
3E9[039C]|3EA1) echo 'igen9cv:va:cl:vk:';; #UHD610
9BA[58]) echo 'igen9cv:va:cl:vk:';; #UHD610
3EA[09]) echo 'igen9cw:va:cl:vk:';; #UHD620
3E9[12468AB]) echo 'igen9cx:va:cl:vk:';; #UHD630
9BC[568]|9B[EF]6) echo 'igen9cx:va:cl:vk:';; #UHD630
3EA6) echo 'igen9ci:va:cl:vk:';; #IP645
3EA[58]) echo 'igen9cj:va:cl:vk:';; #IP655
8A5[079BD]|8A71) echo 'igenbi0:va:cl:vk:';; #HD
8A5[1234AC]) echo 'igenbii:va:cl:vk:';; #IP
8A5[68]) echo 'igenbiu:va:cl:vk:';; #UHD
9A6[08]|9A7[08]) echo 'igenxtu:va:cl:vk:';; #UHD
9AC[09]|9AD9|9AF8) echo 'igenxtu:va:cl:vk:';; #UHD
9A4[09]) echo 'igenxti:va:cl:vk:';; #IX
4905) echo 'igenxd1:va:cl:vk:';; #DG1
esac
}
function GET_GPU_TYPE_NVIDIA {
case "${PCIDEVST}" in
*NV1[01578AF]*) GPU_TYPE='nv010';;
*NV2[058A]*) GPU_TYPE='nv020';;
*NV3[01456]*) GPU_TYPE='nv030';;
*NV4[01234]*) GPU_TYPE='nv040';;
# These have to be placed after the preceeding lines
# becuase the shorter names collide w/ the longer ones
*NV[45A]*) GPU_TYPE='nv004';;
*NV3*) GPU_TYPE='nv003';;
*NV1*) GPU_TYPE='nv001';;
# We now return to our regular schedule
*C51|C6[178]|C7[123]*) GPU_TYPE='nv040';;
*G[89][02468]*) GPU_TYPE='nv050:va:vd:cl:';;
*GT2[01][0568]*) GPU_TYPE='nv050:va:vd:cl:';;
*C7[789]*) GPU_TYPE='nv050:va:vd:cl:';;
*MCP[78][9A]*) GPU_TYPE='nv050:va:vd:cl:';;
*GF1[01][046789]*) GPU_TYPE='nv0c0:va:vd:cl:vk';;
*GK[12][01][04678A]*) GPU_TYPE='nv0e0:vd:cl:vk:';;
*GM[12]0[04678B]*) GPU_TYPE='nv110:vd:cl:vk:';;
*GP10[24678]*) GPU_TYPE='nv130:vd:cl:vk:';;
*GV100*) GPU_TYPE='nv140:vd:cl:vk:';;
*TU1[01][2467]*) GPU_TYPE='nv160:vd:cl:vk:';;
*GA10[0246789]*) GPU_TYPE='nv170:vd:cl:vk:';;
esac
}
function IS_REPO_PKG {
pacman -Si "${1}" > /dev/null 2>&1
}
function NETWORK_SCAN {
##############################################################################
local -r BAKTITLE="Network Scan"
local -r HELP_MSG="Scanning network for ${1^^} servers..."
##############################################################################
local PORTNAME="${1^^}" RETVALUE
local -i PORTNMBR DLG_WIDE="$(( ${#HELP_MSG} + TITLEPAD ))"
case "${PORTNAME}" in
NFS) PORTNMBR=2049;;
SMB) PORTNMBR=445;;
esac
case "${BIN[dialog]}" in
*/dialog)
${BIN[dialog]} --infobox "${HELP_MSG}" 3 "${DLG_WIDE}"
"${BIN[nmap]}" -p "${PORTNMBR}" -oG - "${IP_RANGE}" | "${BIN[grep]}" -q open
RETVALUE="${?}"
;;
*/Xdialog)
rm -f /tmp/selection
while true; do
"${BIN[nmap]}" -p "${PORTNMBR}" -oG - "${IP_RANGE}" | "${BIN[grep]}" -q open && "${BIN[touch]}" /tmp/selection
echo 'XXXX'
break
done | ${BIN[dialog]} --title "${TITLEBAR}" --backtitle "${BAKTITLE}" \
--no-buttons --infobox "${HELP_MSG}" 320x80 0
[[ -e /tmp/selection ]] && RETVALUE=0 || RETVALUE=1
;;
*)
"${BIN[nmap]}" -p "${PORTNMBR}" -oG - "${IP_RANGE}" | "${BIN[grep]}" -q open
RETVALUE="${?}"
;;
esac
return "${RETVALUE}"
}
function TRANSLATE_GPU_TYPE {
case "${1}" in
ati0) echo 'Mach series';;
ati1) echo 'Rage series';;
ati2) echo '7000 series';;
ati3) echo '8000 series';;
ati4) echo '9000 series';;
ati5) echo 'X series';;
ts?) echo "${1/ts/Terra Scale }";;
gcn?) echo "${1/gcn/Graphics Core Next }";;
rdna?) echo "${1/rdna/Radeon DNA }";;
igen1a) echo 'Intel Auburn Gen 1 i740';;
igen1p) echo 'Intel Portola Gen 1 i752';;
igen1w) echo 'Intel Whitney Gen 1 i810';;
igen1s) echo 'Intel Solano Gen 1 i815';;
igen2a) echo 'Intel Almador Gen 2 Extreme Graphics';;
igen2b) echo 'Intel Brookdale Gen 2 Extreme Graphics';;
igen2s) echo 'Intel Springdale Gen 2 Extreme Graphics 2';;
igen2m) echo 'Intel Montara Gen 2 Extreme Graphics 2';;
igen3g) echo 'Intel Grantsdale Gen 3 Graphics Media Accelerator 900';;
igen3a) echo 'Intel Alviso Gen 3 Graphics Media Accelerator 900';;
igen3l) echo 'Intel Lakeport Gen 3 Graphics Media Accelerator 950';;
igen3c) echo 'Intel Calistoga Gen 3 Graphics Media Accelerator 950';;
igen3b) echo 'Intel Bearlake Gen 3 Graphics Media Accelerator 3100';;
igen3p) echo 'Intel Pineview Gen 3 Graphics Media Accelerator 3150';;
igen4lp) echo 'Intel Lakeport Gen 4 Graphics Media Accelerator 3000';;
igen4bw) echo 'Intel Broadwater Gen 4 Graphics Media Accelerator 3000';;
igen4bx) echo 'Intel Broadwater Gen 4 Graphics Media Accelerator X3000';;
igen4bl) echo 'Intel Bearlake Gen 4 Graphics Media Accelerator X3500';;
igen4cl) echo 'Intel Crestline Gen 4 Graphics Media Accelerator X3100';;
igen4el) echo 'Intel Eaglelake Gen 4 Graphics Media Accelerator 4500';;
igen4ct) echo 'Intel Cantiga Gen 4 Graphics Media Accelerator 4500';;
igen5) echo 'Intel Ironlake Gen 5 HD Graphics';;
igen6s2) echo 'Intel Sandy Bridge Gen 6 HD Graphics 2000';;
igen6s3) echo 'Intel Sandy Bridge Gen 6 HD Graphics 3000';;
igen7i0) echo 'Intel Ivy Bridge Gen 7 HD Graphics';;
igen7i2) echo 'Intel Ivy Bridge Gen 7 HD Graphics 2500';;
igen7i4) echo 'Intel Ivy Bridge Gen 7 HD Graphics 4000';;
igen7b0) echo 'Intel Bay Trail Gen 7 HD Graphics';;
igen7h0) echo 'Intel Haswell Gen 7 HD Graphics';;
igen7h2) echo 'Intel Haswell Gen 7 HD Graphics 4200';;
igen7h4) echo 'Intel Haswell Gen 7 HD Graphics 4400';;
igen7h6) echo 'Intel Haswell Gen 7 HD Graphics 4600';;
igen7h9) echo 'Intel Haswell Gen 7 HD Graphics 5000';;
igen7hi) echo 'Intel Haswell Gen 7 Iris Graphics 5100';;
igen7hj) echo 'Intel Haswell Gen 7 Iris Pro Graphics 5200';;
igen8c0) echo 'Intel Cherryview Gen 8 HD Graphics';;
igen8c4) echo 'Intel Cherryview Gen 8 HD Graphics 400';;
igen8b0) echo 'Intel Broadwell Gen 8 HD Graphics';;
igen8b3) echo 'Intel Broadwell Gen 8 HD Graphics 5300';;
igen8b5) echo 'Intel Broadwell Gen 8 HD Graphics 5500';;
igen8b6) echo 'Intel Broadwell Gen 8 HD Graphics 5600';;
igen8b7) echo 'Intel Broadwell Gen 8 HD Graphics 5700';;
igen8b9) echo 'Intel Broadwell Gen 8 HD Graphics 6000';;
igen8bi) echo 'Intel Broadwell Gen 8 Iris Graphics 6100';;
igen8bj) echo 'Intel Broadwell Gen 8 Iris Graphics 6200';;
igen8bk) echo 'Intel Broadwell Gen 8 Iris Graphics 6300';;
igen9a0) echo 'Intel Apollo Lake Gen 9 HD Graphics';;
igen9a1) echo 'Intel Apollo Lake Gen 9 HD Graphics 500';;
igen9a2) echo 'Intel Apollo Lake Gen 9 HD Graphics 505';;
igen9s0) echo 'Intel Skylake Gen 9 HD Graphics';;
igen9s1) echo 'Intel Skylake Gen 9 HD Graphics 510';;
igen9s2) echo 'Intel Skylake Gen 9 HD Graphics 515';;
igen9s3) echo 'Intel Skylake Gen 9 HD Graphics 520';;
igen9s4) echo 'Intel Skylake Gen 9 HD Graphics 530';;
igen9si) echo 'Intel Skylake Gen 9 Iris Graphics 540';;
igen9sj) echo 'Intel Skylake Gen 9 Iris Graphics 550';;
igen9sk) echo 'Intel Skylake Gen 9 Iris Graphics 555';;
igen9sl) echo 'Intel Skylake Gen 9 Iris Graphics 580';;
igen9gu) echo 'Intel Gemini Lake Gen 9 UHD Graphics 600';;
igen9gv) echo 'Intel Gemini Lake Gen 9 UHD Graphics 605';;
igen9k0) echo 'Intel Kaby Lake Gen 9 HD Graphics';;
igen9k1) echo 'Intel Kaby Lake Gen 9 HD Graphics 610';;
igen9k2) echo 'Intel Kaby Lake Gen 9 HD Graphics 615';;
igen9k3) echo 'Intel Kaby Lake Gen 9 HD Graphics 620';;
igen9k4) echo 'Intel Kaby Lake Gen 9 HD Graphics 630';;
igen9k5) echo 'Intel Kaby Lake Gen 9 HD Graphics 635';;
igen9ku) echo 'Intel Kaby Lake Gen 9 UHD Graphics 615';;
igen9kv) echo 'Intel Kaby Lake Gen 9 UHD Graphics 617';;
igen9kw) echo 'Intel Kaby Lake Gen 9 UHD Graphics 620';;
igen9ki) echo 'Intel Kaby Lake Gen 9 Iris Plus Graphics 640';;
igen9kj) echo 'Intel Kaby Lake Gen 9 Iris Plus Graphics 650';;
igen9c0) echo 'Intel Coffee Lake Gen 9 HD Graphics';;
igen9cu) echo 'Intel Coffee Lake Gen 9 UHD Graphics';;
igen9cv) echo 'Intel Coffee Lake Gen 9 UHD Graphics 610';;
igen9cw) echo 'Intel Coffee Lake Gen 9 UHD Graphics 620';;
igen9cx) echo 'Intel Coffee Lake Gen 9 UHD Graphics 630';;
igen9ci) echo 'Intel Coffee Lake Gen 9 Iris Plus Graphics 645';;
igen9cj) echo 'Intel Coffee Lake Gen 9 Iris Plus Graphics 655';;
igenbi0) echo 'Intel Ice Lake Gen 11 HD Graphics';;
igenbii) echo 'Intel Ice Lake Gen 11 Iris Plus Graphics';;
igenbiu) echo 'Intel Ice Lake Gen 11 UHD Plus Graphics';;
igenxti) echo 'Intel Tiger Lake Xe Graphics';;
igenxd1) echo 'Intel DG1 Xe Graphics';;
nv001) echo 'Ancient';;
nv003) echo 'Archaic';;
nv004) echo 'Fahrenheit';;
nv010) echo 'Celsius';;
nv020) echo 'Kelvin';;
nv040) echo 'Curie';;
nv050) echo 'Tesla';;
nv0c0) echo 'Fermi';;
nv0e0) echo 'Kepler';;
nv110) echo 'Maxwel';;
nv130) echo 'Pascal';;
nv140) echo 'Volta';;
nv160) echo 'Turing';;
nv170) echo 'Ampere';;
esac
}
function UPDATE_PACMAN_MIRRORLIST {
local GEOIPURL="http://api.geoiplookup.net/" MRRRLIST="/etc/pacman.d/mirrorlist"
local BAN_LIST="-x mirror.theash.xyz -x ftp.sudhip.com -x dfw.mirror.rackspace.com"
GET_PRIVILEGE || exit 1
# Avoid repeated attempts to update the mirrorlist -- once an hour is good enough
if [[ $(($("${BIN[date]}" +%s)-$("${BIN[stat]}" -c %Y "${MRRRLIST}"))) -gt 9000 ]]; then
"${BIN[printf]}" "\033[1;34m::\033[97m Geolocating county...\033[0m\n"
COUNTRY="$("${BIN[curl]}" -s "${GEOIPURL}" | "${BIN[grep]}" countryname | ${BIN[sed]} 's/.*<countryname>\(.*\)<\/countryname>.*/\1/g')"
"${BIN[printf]}" " %s\n" "${COUNTRY}"
"${BIN[printf]}" "\033[1;34m::\033[97m Determining Best Mirrors...\033[0m\n"
[[ -n ${BIN[reflector]} ]] && "${BIN[sudo]}" "${BIN[reflector]}" -p https -l 10 -f 5 -c "${COUNTRY}" ${BAN_LIST} --sort rate --save /etc/pacman.d/mirrorlist
"${BIN[grep]}" '^Server' /etc/pacman.d/mirrorlist | "${BIN[sed]}" 's/\(.*\)/ \1/g'
fi
"${BIN[sudo]}" "${BIN[pacman]}" -Sy
}
function INTENTS_BROWSERS {
##############################################################################
local -r BAKTITLE="Web Browser"
local -r HELP_MSG="What kind browser(s) do you want to install?"
##############################################################################
local -a SUGGESTS DESCRIPS
local -i PID2KILL
GET_BROWSERS
SUGGESTS=(blink-based gecko-based webkit2-gtk qt5-webkit)
DESCRIPS=("$("${BIN[tr]}" '\n' ' ' <<< "${BROWSERS_BLINK[@]#*:}" | "${BIN[sed]}" 's/ $//g;s/ /, /g;s/_/ /g')"
"$("${BIN[tr]}" '\n' ' ' <<< "${BROWSERS_GECKO[@]#*:}" | "${BIN[sed]}" 's/ $//g;s/ /, /g;s/_/ /g')"
"$("${BIN[tr]}" '\n' ' ' <<< "${BROWSERS_WBKT2GTK[@]#*:}" | "${BIN[sed]}" 's/ $//g;s/ /, /g;s/_/ /g')"
"$("${BIN[tr]}" '\n' ' ' <<< "${BROWSERS_QTWEBKIT[@]#*:}" | "${BIN[sed]}" 's/ $//g;s/ /, /g;s/_/ /g')")
[[ -n ${PID2KILL} ]] && kill -9 "${PID2KILL}"
SELECTNS=(off off off off)
DIALOG_MULTI_SELECT "${TITLEBAR}" "${BAKTITLE}" 'showtags' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' 'SELECTNS' || return "${?}"
INTENTS[browsers]="$(${BIN[xargs]} < <(</tmp/selection))"
}
function INTENTS_DESKTOP {
##############################################################################
local -r BAKTITLE="Desktop Environment"
local -r HELP_MSG="What kind of desktop do you want to set up?"
##############################################################################
local -a SUGGESTS DESCRIPS
SUGGESTS=(budgie cinnamon deepin gnome icewm lxde lxqt mate openbox pekwm plasma ukui xfce4)
DESCRIPS=('GTK-based desktop environment from Solus'
'GTK-based desktop environment from LinuxMint'
'Qt-based desktop environment from Deepin'
'Premier GTK-based desktop environment from The GNOME Project'
'Lightweight window manager by Marko Maček, includes a session manager'
'GTK-based Lightweight X11 Desktop Environment'
'Qt-based Lightweight X11 Qt desktop environment'
'GTK-based desktop based on GNOME 2'
'A Blackbox spin-off that has evolved into its own, includes a session manager'
'An AEWM++ spin-off that has evolved into its own, includes a session manager.'
'Premier Qt-based desktop from KDE'
'Qt-based desktop environment of Ubuntu Kylin'
'A modular GTK-based desktop environment')
DIALOG_SINGLE_SELECT "${TITLEBAR}" "${BAKTITLE}" 'showtags' 'desktop' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' || return "${?}"
INTENTS[desktop]="$(</tmp/selection)"
case "${INTENTS[desktop]}" in
budgie|cinnamon|deepin|gnome|lxde|mate|xfce) INTENTS[guitk]+='gtk';;
lxqt|plasma) INTENTS[guitk]+='qt';;
esac
return 0
}
function INTENTS_GUI_TOOLKIT {
##############################################################################
local -r BAKTITLE="GUI Toolkit"
local -r HELP_MSG="Which toolkit do you prefer?"
##############################################################################
local -a SUGGESTS DESCRIPS
SUGGESTS=(gtk qt)
DESCRIPS=(GTK Qt)
DIALOG_SINGLE_SELECT "${TITLEBAR}" "${BAKTITLE}" 'hidetags' 'gtk' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' || return "${?}"
INTENTS[guitk]="$(</tmp/selection)"
}
function INTENTS_PURPOSE {
##############################################################################
local -r BAKTITLE="Purpose"
local -r HELP_MSG="What will be the intended use of this installation?"
##############################################################################
local -a SUGGESTS DESCRIPS
SUGGESTS=(desktop server rescue)
DESCRIPS=('Standard desktop use' 'Standard server use' 'Rescue Media')
DIALOG_SINGLE_SELECT "${TITLEBAR}" "${BAKTITLE}" 'showtags' 'desktop' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' || return "${?}"
INTENTS[purpose]="$(</tmp/selection)"
}
function INTENTS_RUNTIME {
##############################################################################
local -r BAKTITLE="Runtime Environment"
local -r HELP_MSG="What will be the intended use of this installation?"
##############################################################################
local -a SUGGESTS DESCRIPS
SUGGESTS=(hardware virtual container)
DESCRIPS=('Run directly on hardware' 'Run under virtualization' 'Run inside container')
DIALOG_SINGLE_SELECT "${TITLEBAR}" "${BAKTITLE}" 'showtags' 'hardware' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' || return "${?}"
INTENTS[runtime]="$(</tmp/selection)"
}
function INTENTS_SERVERS {
##############################################################################
local -r BAKTITLE="Services"
local -r HELP_MSG="Which services will be provided?"
##############################################################################
local -a SUGGESTS DESCRIPS SELECTNS
SUGGESTS=(database email file lan media web)
DESCRIPS=('Database server' 'E-mail server' 'File server'
'LAN services' 'Media server' 'Web server')
SELECTNS=(off off off off off off)
DIALOG_MULTI_SELECT "${TITLEBAR}" "${BAKTITLE}" 'showtags' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' 'SELECTNS' || return "${?}"
INTENTS[servers]="$(${BIN[xargs]} < <(</tmp/selection))"
}
function INTENTS_WEBSRVR_COMPONENTS {
##############################################################################
local -r BAKTITLE="Web Server Components"
local -r HELP_MSG="Choose LAN services:"
##############################################################################
local -a SUGGESTS DESCRIPS
SUGGESTS=(certbot database php redis)
DESCRIPS=("Let'\\''s Encrypt automated SSL certificates"
'PHP Hypertext Processor'
'Remote Dictionary Server \(caching\)')
SELECTNS=(on on on on)
DIALOG_MULTI_SELECT "${TITLEBAR}" "${BAKTITLE}" 'showtags' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' 'SELECTNS'|| return "${?}"
if "${BIN[grep]}" -q database /tmp/selection; then
INTENTS[servers]+=' database'
sed -i 's/database//g;s/ \+/ /g' /tmp/selection
fi
INTENTS[websrvr]="$(${BIN[xargs]} < <(</tmp/selection))"
}
function OPTION_ENTROPY {
##############################################################################
local -r BAKTITLE="RNG Entropy"
local -r HELP_MSG="Install rng-tools to enhance RNG entropy?"
##############################################################################
DIALOG_YESNO "${TITLEBAR}" "${BAKTITLE}" "${HELP_MSG}" \
&& PACKAGES[optional]+='rng-tools '
return 0
}
function OPTION_NEOFETCH {
##############################################################################
local -r BAKTITLE="NeoFetch"
local -r HELP_MSG="Install the neofetch system information tool?"
##############################################################################
DIALOG_YESNO "${TITLEBAR}" "${BAKTITLE}" "${HELP_MSG}" \
&& PACKAGES[optional]+='neofetch '
return 0
}
function OPTION_PLYMOUTH {
IS_REPO_PKG 'plymouth' || IS_REPO_PKG 'plymouth-git' || return 0
##############################################################################
local -r BAKTITLE="Plymouth"
local -r HELP_MSG="Install graphical boot splash screen?"
##############################################################################
if DIALOG_YESNO "${TITLEBAR}" "${BAKTITLE}" "${HELP_MSG}"; then
if IS_REPO_PKG 'plymouth-git'; then
PACKAGES[optional]+='plymouth-git '
else
PACKAGES[optional]+='plymouth '
fi
if [[ ${PACKAGES[dispmngr]} == gdm ]]; then
IS_REPO_PKG 'gdm-plymouth' && PACKAGES[dispmngr]='gdm-plymouth'
fi
fi
return 0
}
function OPTION_SCRIPT_DEBUGGING {
##############################################################################
local -r BAKTITLE="Shellcheck"
local -r HELP_MSG="Install shellcheck to debug shell scripts?"
##############################################################################
DIALOG_YESNO "${TITLEBAR}" "${BAKTITLE}" "${HELP_MSG}" \
&& PACKAGES[optional]+='shellcheck '
return 0
}
function OPTION_STEAM {
IS_REPO_PKG steam || return 0
##############################################################################
local -r BAKTITLE="Steam"
local -r HELP_MSG="Install Valve'\\''s Steam client?"
##############################################################################
DIALOG_YESNO "${TITLEBAR}" "${BAKTITLE}" "${HELP_MSG}" \
&& PACKAGES[steam]='steam'
if [[ -n ${PACKAGES[steam]} ]]; then
PACKAGES[steam]+=' steam-native-runtime ttf-liberation'
if [[ ${PACKAGES[vaapi]} =~ libva-vdpau-driver ]]; then
PACKAGES[steam]+=' lib32-nvidia-utils'
else
PACKAGES[steam]+=' lib32-mesa'
fi
[[ -z ${PACKAGES[netmngr]} ]] && PACKAGES[steam]+=' lib32-systemd'
IS_REPO_PKG 'steamtinkerlaunch' && PACKAGES[steam]+=' steamtinkerlaunch'
fi
return 0
}
function OPTION_THUMBNAILERS {
[[ ${INTENTS[guitk]} =~ qt ]] && local -r THUMBERS='ffmpegthumbs'
[[ ${INTENTS[guitk]} =~ gtk ]] && local -r THUMBERS='ffmpegthumbnailer tumbler webp-pixbuf-loader'
##############################################################################
local -r BAKTITLE="Thumbnailers"
local -r HELP_MSG="Install ${THUMBERS/ / and }?"
##############################################################################
DIALOG_YESNO "${TITLEBAR}" "${BAKTITLE}" "${HELP_MSG}" \
&& PACKAGES[thumbs]="${THUMBERS}"
return 0
}
function OPTION_TIME_SYNC {
# If ntp is already selected, then use that.
[[ ${PACKAGES[lansrvcs]} =~ ntp ]] && return 0
##############################################################################
local -r BAKTITLE="Time Synchronization"
local -r HELP_MSG="Use systemd-timesyncd to synchronize time?"
##############################################################################
DIALOG_YESNO "${TITLEBAR}" "${BAKTITLE}" "${HELP_MSG}" \
|| PACKAGES[lansrvcs]="$("${BIN[xargs]}" <<< "${PACKAGES[lansrvcs]} ntp")"
return 0
}
function PACKAGESEL_AUR {
############################################################################
local -r BAKTITLE="Arch User Repository"
local -r HELP_MSG="Choose packages to compile/install from the AUR:"
############################################################################
local -a SUGGESTS DESCRIPS SELSTATE
SUGGESTS=(base-devel arch-install-scripts)
DESCRIPS=('Base utilities required to compile packages from the AUR'
'Scripts to aid in installing Arch Linux (pacstrap, arch-chroot)')
SELSTATE=(on on)
if [[ ${BIN[dialog]} =~ /dialog ]]; then
${BIN[dialog]} --infobox "Looking for available packages..." 3 37
elif [[ ${BIN[dialog]} =~ Xdialog ]]; then
${BIN[dialog]} --title "${TITLEBAR}" --backtitle "${BAKTITLE}" \
--no-buttons --infobox "Looking for available packages..." 6 37 0 &
PID2KILL="${!}"
fi
if IS_REPO_PKG 'yay'; then
SUGGESTS+=(yay)
DESCRIPS+=('Pacman wrapper and AUR helper written in Go')
SELSTATE+=(off)
fi;
if IS_REPO_PKG 'pikaur'; then
SUGGESTS+=(pikaur)
DESCRIPS+=('Pacman wrapper and AUR helper written in Python')
SELSTATE+=(off)
elif IS_REPO_PKG 'pikaur-git'; then
SUGGESTS+=(pikaur-git)
DESCRIPS+=('Pacman wrapper and AUR helper written in Python')
SELSTATE+=(off)
fi;
if IS_REPO_PKG 'paru'; then
SUGGESTS+=(paru)
DESCRIPS+=('Pacman wrapper and AUR helper written in Rust')
SELSTATE+=(off)
fi;
if IS_REPO_PKG 'chaotic-keyring'; then
SUGGESTS+=(chaotic-keyring chaotic-mirrorlist)
DESCRIPS+=('Chaotic-AUR PGP keyring' 'Chaotic-AUR mirror list')
SELSTATE+=(off off)
fi
[[ -n ${PID2KILL} ]] && kill -9 "${PID2KILL}"
DIALOG_MULTI_SELECT "${TITLEBAR}" "${BAKTITLE}" 'showtags' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' 'SELSTATE' || return "${?}"
PACKAGES[aurdevel]="$(${BIN[xargs]} < <(</tmp/selection))"
}
function PACKAGESEL_BOOT_LOADER {
# Containers don't need boot loaders
[[ ${INTENTS[runtime]} == container ]] && return 0
##############################################################################
local -r BAKTITLE="Boot Loader"
local -r HELP_MSG="Choose a Boot Loader:"
##############################################################################
local -a SUGGESTS DESCRIPS
SUGGESTS=(grub refind syslinux systemd-boot none)
DESCRIPS=("Supports BIOS and UEFI multi-arch; all filesystems"
"Supports UEFI same-arch only; ext, btrfs, hfs, and iso filesystems"
"Supports BIOS and UEFI same-arch; ext, ntfs, and xfs filesystems "
"Supports UEFI same-arch only; filesystem support from firmware"
"Do not install a boot loader")
if [[ ${SYSTEM[fw-type]} == uefi ]]; then
if [[ ${SYSTEM[fw-bits]} == 32 ]] && [[ ${SYSTEM[cpu-bits]} == 64 ]]; then
DFLTITEM='grub'
else
if [[ ${INTENTS[purpose]} == server ]]; then
DFLTITEM='systemd-boot'
else
DFLTITEM='refind'
fi
fi
else
DFLTITEM='syslinux'
fi
DIALOG_SINGLE_SELECT "${TITLEBAR}" "${BAKTITLE}" 'showtags' "${DFLTITEM}" \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' || return "${?}"
SELECTED="$(</tmp/selection)"
[[ systemd-boot,none =~ ${SELECTED} ]] || PACKAGES[bootload]="${SELECTED}"
return 0
}
function PACKAGESEL_BOOT_TOOLS {
# Containers don't need boot loaders
[[ ${INTENTS[runtime]} == container ]] && return 0
##############################################################################
local -r BAKTITLE="Boot Tools"
local -r HELP_MSG="Choose boot tools:"
##############################################################################
local -a SUGGESTS DESCRIPS SELECTNS
local -i DLG_HIGH DLG_WIDE LST_HIGH
SUGGESTS=(memtest86+)
DESCRIPS=('Boot-time RAM diagnostic (BIOS)')
[[ ${SYSTEM[fw-type]} == bios ]] && SELECTNS+=(on) || SELECTNS+=(off)
if IS_REPO_PKG 'memtest86-efi'; then
SUGGESTS+=(memtest86-efi)
DESCRIPS+=('Boot-time RAM diagnostic (UEFI)')
[[ ${SYSTEM[fw-type]} == uefi ]] && SELECTNS+=(on) || SELECTNS+=(off)
fi
if [[ ${SYSTEM[cpu-bits]} == 64 ]]; then
SUGGESTS+=(edk2-shell)
DESCRIPS+=('EDK UEFI Shell')
[[ ${SYSTEM[fw-type]} == bios ]] && SELECTNS+=(off) || SELECTNS+=(on)
fi
SUGGESTS+=(efibootmgr)
DESCRIPS+=('UEFI boot manager')
[[ ${SYSTEM[fw-type]} == bios ]] && SELECTNS+=(off) || SELECTNS+=(on)
SUGGESTS+=(efitools sbsigntools)
DESCRIPS+=('UEFI secure boot tools' 'Secure Boot binary signing tools')
SELECTNS+=(off off)
LST_HIGH="${#SUGGESTS[@]}"; DLG_HIGH="$((LST_HIGH + LIST_PAD))"
DLG_WIDE="$(( ( $(MAX_LENGTH 'SUGGESTS') + $(MAX_LENGTH 'DESCRIPS') ) + MULTIPAD ))"
if [[ ${INTENTS[purpose]} =~ rescue ]]; then
SELECTNS=(on on on on on on)
fi
DIALOG_MULTI_SELECT "${TITLEBAR}" "${BAKTITLE}" 'showtags' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' 'SELECTNS' || return "${?}"
PACKAGES[boottool]="$(${BIN[xargs]} < <(</tmp/selection))"
}
function PACKAGESEL_BROWSERS {
local -a SUGGESTS DESCRIPS SELSTATE
if [[ ${INTENTS[browsers]} =~ blink-based ]]; then
############################################################################
local BAKTITLE="Blink-Based Web Browsers"
local HELP_MSG="Choose Blink-based web browsers:"
############################################################################
SUGGESTS=("${BROWSERS_BLINK[@]%:*}")
DESCRIPS=("${BROWSERS_BLINK[@]#*:}")
DESCRIPS=("${DESCRIPS[@]/_/ }")
SELSTATE=(off off off off off off off off off)
DIALOG_MULTI_SELECT "${TITLEBAR}" "${BAKTITLE}" 'hidetags' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' 'SELSTATE' || return "${?}"
PACKAGES[browsers]="$("${BIN[xargs]}" <<< "${PACKAGES[browsers]} $(</tmp/selection)")"
if [[ -n ${PACKAGES[borwsers]} ]] && [[ ${INTENTS[desktop]} == gnome ]]; then
IS_REPO_PKG 'chrome-gnome-shell' && PACKAGES[browsers]+=' chrome-gnome-shell'
fi
fi; if [[ ${INTENTS[browsers]} =~ gecko-based ]]; then
############################################################################
local BAKTITLE="Gecko-Based Web Browsers"
local HELP_MSG="Choose Gecko-based web browsers:"
############################################################################
SUGGESTS=("${BROWSERS_GECKO[@]%:*}")
DESCRIPS=("${BROWSERS_GECKO[@]#*:}")
DESCRIPS=("${DESCRIPS[@]/_/ }")
SELSTATE=(off off off off off off off off off)
DIALOG_MULTI_SELECT "${TITLEBAR}" "${BAKTITLE}" 'hidetags' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' 'SELSTATE' || return "${?}"
PACKAGES[browsers]="$("${BIN[xargs]}" <<< "${PACKAGES[browsers]} $(</tmp/selection)")"
fi; if [[ ${INTENTS[browsers]} =~ webkit2-gtk ]]; then
############################################################################
local BAKTITLE="WebKit2-GTK Web Browsers"
local HELP_MSG="Choose WebKit2-GTK web browsers:"
############################################################################
SUGGESTS=("${BROWSERS_WBKT2GTK[@]%:*}")
DESCRIPS=("${BROWSERS_WBKT2GTK[@]#*:}")
DESCRIPS=("${DESCRIPS[@]/_/ }")
SELSTATE=(off off off off off off off off off)
DIALOG_MULTI_SELECT "${TITLEBAR}" "${BAKTITLE}" 'hidetags' \
"${HELP_MSG}" 'SUGGESTS' 'DESCRIPS' 'SELSTATE' || return "${?}"
PACKAGES[browsers]="$("${BIN[xargs]}" <<< "${PACKAGES[browsers]} $(</tmp/selection)")"
fi; if [[ ${INTENTS[browsers]} =~ qt5-webkit ]]; then
############################################################################
local BAKTITLE="Qt5-WebKit Web Browsers"
local HELP_MSG="Choose Qt5-WebKit web browsers:"
############################################################################
SUGGESTS=("${BROWSERS_QTWEBKIT[@]%:*}")
DESCRIPS=("${BROWSERS_QTWEBKIT[@]#*:}")
DESCRIPS=("${DESCRIPS[@]/_/ }")