-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer
executable file
·3590 lines (3187 loc) · 121 KB
/
installer
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
#!/bin/bash
# This program is free software, provided under the GNU GPL
# Written by Nathaniel Maia for Archlabs, works in most Arch based distros
# Some ideas and code reworked from other resources
# AIF, Calamares, and the Arch Wiki.. Credit where credit is due
# Edited By Ybenel For DarkOs Schmedding
# shellcheck disable=SC2086,SC2046,SC2254,SC2164
VER=9x1
# default values {
: "${DIST=DarkOs}" # distro name if not set
: "${MNT=/mnt}" # installation root mountpoint if not set
SYS=Unknown # boot type, to be determined: UEFI/BIOS
FONT=ter-i16n # font used for the linux console
HOOKS=shutdown # additional mkinitcpio HOOKS
SEL=0 # currently selected main menu item
BTRFS=0 # is btrfs used, 1 = btrfs alone, 2 = btrfs + subvolume(s)
PACSTRAP=1 # use pacstrap or copy the iso filesystem
EXMNTS='' # extra partitions that were mounted, used to verify mountpoint and show user
USERCMD='' # optional command(s) entered by the user to run in the chroot
ANS=/tmp/ans # dialog answer output file
BG=/tmp/bgout # output from background process
ERR=/tmp/errlog # stderr log used internally by errshow()
DBG=/tmp/debuglog # debug log file when passed -d
RUN=/run/archiso/bootmnt/arch/boot # path for live system /boot
VIRT="$(systemd-detect-virt)"
MEM="$(awk '/MemTotal/ {print int($2 / 1024) "M"}' /proc/meminfo)"
LOCALES="$(awk '/\.UTF-8/ {gsub(/# .*|#/, ""); if ($1) {print $1 " - "}}' /etc/locale.gen)"
CMAPS="$(find /usr/share/kbd/keymaps -name '*.map.gz' | awk '{gsub(/\.map\.gz|.*\//, ""); print $1 " - "}' | sort)"
[[ $LINES ]] || LINES=$(tput lines)
[[ $COLUMNS ]] || COLUMNS=$(tput cols)
export DIALOGOPTS="--cr-wrap"
# package arrays built later from user selections
typeset -a SES_PKGS USER_PKGS
# }
# packages installed specific to darkos, installed when any session is chosen {
typeset -a BASE_PKGS=(
"alsa-firmware"
"alsa-lib"
"alsa-plugins"
"darkos-wallpapers"
"darkos-grub-theme"
"darkos-ascii"
"darkos-systemd"
"darkos-live-config"
"darkos-tweaks"
"ffmpeg"
"gst-libav"
"gst-plugins-base"
"gst-plugins-good"
"gstreamer"
"gtk3"
"gvfs"
"libmad"
"libmatroska"
"pamixer"
"pavucontrol"
"pulseaudio"
"pulseaudio-alsa"
"scrot"
"sudo"
"xdg-user-dirs"
"xorg"
"xorg-drivers" # TODO: should we only install specific drivers?
"xterm"
) # }
# packages installed for most window managers to provide some basic functionality {
typeset -a WM_PKGS=(
"arandr"
"dunst"
"exo"
"feh"
"gnome-keyring"
"gsimplecal"
"network-manager-applet"
"nitrogen"
"polkit-gnome"
"picom"
"volumeicon"
"wmctrl"
"xclip"
"xdotool"
"xfce4-power-manager"
"xfce4-settings"
) # }
# packages installed when choosing to use pacstrap {
typeset -a ISO_PKGS=(
"arch-install-scripts"
"crda"
"ddrescue"
"dhclient"
"dhcpcd"
"diffutils"
"dmraid"
"dnsmasq"
"dnsutils"
"dosfstools"
"ethtool"
"exfat-utils"
"f2fs-tools"
"fsarchiver"
"hdparm"
"iputils"
"ipw2100-fw"
"ipw2200-fw"
"iwd"
"lftp"
"linux-firmware"
"lm_sensors"
"lsb-release"
"lsscsi"
"man-db"
"man-pages"
"mdadm"
"mtools"
"nfs-utils"
"nilfs-utils"
"ntp"
"openconnect"
"openssh"
"openvpn"
"p7zip"
"pacman-contrib"
"partclone"
"parted"
"partimage"
"ppp"
"pptpclient"
"reflector"
"rp-pppoe"
"sdparm"
"sg3_utils"
"tcpdump"
"terminus-font"
"testdisk"
"ttf-dejavu"
"usb_modeswitch"
"usbutils"
"vi"
"wireless-regdb"
"wireless_tools"
"wpa_supplicant"
"wvdial"
) # }
# packages installed for each wm/de, most are depends of the skel packages {
declare -A WM_EXT=(
[awesome]=''
[bspwm]=''
[cinnamon]='gnome-terminal'
[deepin]='deepin-extra'
[dwm]='nitrogen polkit-gnome gnome-keyring dunst lxappearance'
[fluxbox]=''
[gnome]='gnome-tweaks'
[i3-gaps]=''
[jwm]=''
[lxqt]='breeze breeze-icons picom libpulse network-manager-applet'
[openbox]=''
[plasma]='kde-applications-meta powerdevil'
[xfce4]='xfce4-goodies'
) # }
# packages installed for each login option {
declare -A LOGIN_PKGS=(
[gdm]='gdm'
[lightdm]='lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice'
[sddm]='sddm'
[xinit]='xorg-xinit'
) # }
# extras installed for user selected packages {
# if a package requires additional packages that aren't already dependencies
# they can be added here e.g. [package]="extra"
declare -A PKG_EXT=(
[bluez]='bluez-libs bluez-utils bluez-tools bluez-plugins bluez-hid2hci'
[cairo-dock]='cairo-dock-plug-ins'
[kdenlive]='qt5ct'
[mpd]='mpc'
[mupdf]='mupdf-tools'
[noto-fonts]='noto-fonts-emoji'
[pcmanfm]='tumbler'
[qbittorrent]='qt5ct'
[qutebrowser]='qt5ct'
[thunar]='tumbler thunar-volman'
[transmission-qt]='qt5ct'
[vlc]='qt5ct'
[zathura]='zathura-pdf-poppler'
) # }
# commands used to install each bootloader, however most get modified during runtime {
declare -A BCMDS=(
[efistub]='efibootmgr -v -d /dev/sda -p 1 -c -l'
[grub]='grub-install --recheck --force'
[refind-efi]='refind-install'
[syslinux]='syslinux-install_update -i -a -m'
[systemd-boot]='bootctl --path=/boot install'
) # }
# executable name for each wm/de used in ~/.xinitrc {
declare -A WM_SESSIONS=(
[awesome]='awesome'
[bspwm]='bspwm'
[cinnamon]='cinnamon-session'
[deepin]='startdde'
[dwm]='dwm'
[fluxbox]='startfluxbox'
[gnome]='gnome-session'
[i3-gaps]='i3'
[jwm]='jwm'
[lxqt]='startlxqt'
[openbox]='openbox-session'
[plasma]='startplasma-x11'
[xfce4]='startxfce4'
) # }
# files offered for editing after install is complete {
declare -A EDIT_FILES=(
[login]='' # login is populated once we know the username and shell
[fstab]='/etc/fstab'
[sudoers]='/etc/sudoers'
[crypttab]='/etc/crypttab'
[pacman]='/etc/pacman.conf'
[console]='/etc/vconsole.conf'
[mkinitcpio]='/etc/mkinitcpio.conf'
[hostname]='/etc/hostname /etc/hosts'
[bootloader]="/boot/loader/entries/$DIST.conf" # ** based on bootloader
[locale]='/etc/locale.conf /etc/default/locale'
[keyboard]='/etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard'
) # }
# mkfs command flags for filesystem formatting {
declare -A FS_CMD_FLAGS=(
[btrfs]='-fq'
[ext2]='-q'
[ext3]='-q'
[ext4]='-q'
[f2fs]='-f'
[jfs]='-q'
[nilfs2]='-q'
[ntfs]='-q'
[reiserfs]='-q'
[vfat]='-F32'
[xfs]='-fq'
) # }
# mount options for each filesystem {
declare -A FS_OPTS=(
[vfat]=''
[ntfs]=''
[ext2]=''
[ext3]=''
[jfs]='discard errors=continue errors=panic nointegrity'
[reiserfs]='acl nolog notail replayonly user_xattr off'
[ext4]='discard dealloc nofail noacl relatime noatime nobarrier nodelalloc'
[xfs]='discard filestreams ikeep largeio noalign nobarrier norecovery noquota wsync'
[nilfs2]='discard nobarrier errors=continue errors=panic order=relaxed order=strict norecovery'
[f2fs]='discard fastboot flush_merge data_flush inline_xattr inline_data noinline_data inline_dentry no_heap noacl nobarrier norecovery noextent_cache disable_roll_forward disable_ext_identify'
[btrfs]='autodefrag compress=zlib compress=lzo compress=no compress-force=zlib compress-force=lzo discard noacl noatime nodatasum nospace_cache recovery skip_balance space_cache ssd ssd_spread'
) # }
# mirrorlist country codes to names table {
typeset -A COUNTRIES=(
[AU]='Australia'
[AT]='Austria'
[BD]='Bangladesh'
[BY]='Belarus'
[BE]='Belgium'
[BA]='Bosnia and Herzegovina'
[BR]='Brazil'
[BG]='Bulgaria'
[CA]='Canada'
[CL]='Chile'
[CN]='China'
[CO]='Colombia'
[HR]='Croatia'
[CZ]='Czechia'
[DK]='Denmark'
[EC]='Ecuador'
[FI]='Finland'
[FR]='France'
[GE]='Georgia'
[DE]='Germany'
[GR]='Greece'
[HK]='Hong Kong'
[HU]='Hungary'
[IS]='Iceland'
[IN]='India'
[ID]='Indonesia'
[IR]='Iran'
[IE]='Ireland'
[IL]='Israel'
[IT]='Italy'
[JP]='Japan'
[KZ]='Kazakhstan'
[KE]='Kenya'
[LV]='Latvia'
[LT]='Lithuania'
[LU]='Luxembourg'
[NL]='Netherlands'
[NC]='New Caledonia'
[NZ]='New Zealand'
[MK]='North Macedonia'
[NO]='Norway'
[PY]='Paraguay'
[PH]='Philippines'
[PL]='Poland'
[PT]='Portugal'
[RO]='Romania'
[RU]='Russia'
[RS]='Serbia'
[SG]='Singapore'
[SK]='Slovakia'
[SI]='Slovenia'
[ZA]='South Africa'
[KR]='South Korea'
[ES]='Spain'
[SE]='Sweden'
[CH]='Switzerland'
[TW]='Taiwan'
[TH]='Thailand'
[TR]='Turkey'
[UA]='Ukraine'
[GB]='United Kingdom'
[US]='United States'
[VN]='Vietnam'
) # }
# dialog text variables {
# Basics (somewhat in order)
_keymap="\nSelect which keymap to use from the list below.\n\nThis will determine the installed system keymap once entering a graphical environment.\n\ndefault: us"
_vconsole="\nSelect the console keymap, the console is the tty shell you reach before starting a graphical environment (Xorg).\n\nIts keymap is separate from the one used by the graphical environments, though many do use the same such as 'us' English.\n\ndefault: us"
_prep="\nThis is the installer main menu, once a step is complete you will return here.\n\nOn successful completion of a step the cursor will advance to the next step.\nOn failure the cursor will be placed on the step required to advance (when possible).\n\nSteps beginning with an asterisk (*) are required.\n\nOnce all required steps are complete, selecting the last step will finalize the install."
_device="\nSelect a device to use from the list below.\n\nDevices (/dev) are the available drives on the system. /sda, /sdb, /sdc ..."
_mount="\nUse [Space] to toggle mount options from below, press [Enter] when done to confirm selection.\n\nNot selecting any and confirming will run an automatic mount."
_warn="\nIMPORTANT: Choose carefully when editing, formatting, and mounting partitions or your DATA MAY BE LOST.\n\nTo mount a partition without formatting it, select 'skip' when prompted to choose a file system during the mounting stage.\nThis can only be used for partitions that already contain a file system and cannot be the root (/) partition, it needs to be formatted before install.\n"
_part="\nFull device auto partitioning is available for beginners otherwise cfdisk is recommended.\n\n - All systems will require a root partition (8G or greater).\n - UEFI or BIOS using LUKS without LVM require a separate boot partition (100-512M)."
_btrfs="\nBtrfs can be used with or without creating subvolumes.\n\nAn initial subvolume will be created and mounted first,\nadditional subvolumes branching from this can be created after.\n\nCreate subvolumes?\n"
_uefi="\nSelect the EFI boot partition (/boot), required for UEFI boot.\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as vfat/fat32 if not already."
_bios="\nDo you want to use a separate boot partition? (optional)\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as ext3/4 if not already."
_biosluks="\nSelect the boot partition (/boot), required for LUKS.\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as ext3/4 if not already."
_format="is already formatted correctly.\n\nFor a clean install, existing partitions should be formatted, however this removes ALL data (bootloaders) on the partition so choose carefully.\n\nDo you want to format the partition?\n"
_swapsize="\nEnter the size of the swapfile in megabytes (M) or gigabytes (G).\n\ne.g. 100M will create a 100 megabyte swapfile, while 10G will create a 10 gigabyte swapfile.\n\nFor ease of use and as an example it is filled in to match the size of your system memory (RAM).\n\nMust be greater than 1, contain only whole numbers, and end with either M or G."
_expart="\nYou can now choose any additional partitions you want mounted, you'll be asked for a mountpoint after.\n\nSelect 'done' to finish the mounting step and begin unpacking the base system in the background."
_exmnt="\nWhere do you want the partition mounted?\n\nEnsure the name begins with a slash (/).\nExamples include: /usr, /home, /var, etc."
_bginstall="\nThe background base install will now start, select which base to use\n\nPacstrap - downloads all packages, avoids issues but can be slower depending on your network.\n\nCopy ISO - faster and not network dependant but can result in installation issues when using an older ISO.\n"
_user="\nEnter a name and password for the new user account.\n\nThe name must not use capital letters, contain any periods (.), end with a hyphen (-), or include any colons (:)\n\nNOTE: Use [Up], [Down], or [Tab] to switch between fields, and [Enter] to accept."
_hostname="\nEnter a hostname for the new system.\n\nA hostname is used to identify systems on the network.\n\nIt's restricted to alphanumeric characters (a-z, A-Z, 0-9).\nIt can contain hyphens (-) BUT NOT at the beginning or end."
_locale="\nLocale determines the system language and currency formats.\n\nThe format for locale names is languagecode_COUNTRYCODE\n\ne.g. en_US is: English United States\n en_GB is: English Great Britain"
_timez="\nSelect your timezone country or continent from the list below"
_timesubz="\nSelect your time zone city.\n\nTIP: Pressing a letter key repeatedly navigates between entries beginning with that letter."
_sessions="\nUse [Space] to toggle available sessions, use [Enter] to accept the selection and continue.\n\nA basic package set will be installed for compatibility and functionality."
_login="\nSelect which of your session choices to use for the initial login.\n\nYou can be change this later by editing your ~/.xinitrc"
_autologin="\nDo you want autologin enabled for USER?\n\nIf so the following two files will be created (disable autologin by removing them):\n\n - /home/USER/RC (run startx when logging in on tty1)\n - /etc/systemd/system/[email protected]/autologin.conf (login USER without password)\n"
_packages="\nUse [Space] to toggle packages then press [Enter] to accept.\n\nPackages may be installed by your DE/WM (if any), or for the packages you select."
_usercmd="\nEnter command to be run in the newly installed system (chroot) below.\n\nAn example use case would be installing packages or editing files not offered in the menus.\n\nBecause the command will be run in a chroot not every command will function correctly, additionally the command will not be sanity checked, it's your system so exercise caution.\n\nMore than one command may be run using standard bash syntax.\n"
_edit="\nBefore exiting you can select configuration files to review/change.\n\nIf you need to make other changes with the drives still mounted, use Ctrl-z to pause the installer, when finished type 'fg' and [Enter] to resume the installer, if you want to avoid the automatic reboot using Ctrl-c will cleanly exit."
# LUKS
_luksmenu="\nA separate boot partition without encryption or logical volume management (LVM) is required (except BIOS systems using grub).\n\nBasic uses the default encryption settings, and is recommended for beginners. Advanced allows cypher and key size parameters to be entered manually."
_luksomenu="\nEnter a name and password for the encrypted device.\n\nIt is not necessary to prefix the name with /dev/mapper/, an example has been provided."
_lukskey="Once the specified flags have been amended, they will automatically be used with the 'cryptsetup -q luksFormat /dev/...' command.\n\nNOTE: Do not specify any additional flags such as -v (--verbose) or -y (--verify-passphrase)."
# LVM
_lvmmenu="\nLogical volume management (LVM) allows 'virtual' drives (volume groups) and partitions (logical volumes)\nto be created from existing device partitions. A volume group must be created first, then one or more logical volumes within it.\n\nLVM can also be used with a LUKS partition to create multiple logical volumes (e.g. root and home) within it."
_lvmvgname="\nEnter a name for the volume group (VG) being created from the partition(s) selected."
_lvmlvname="\nEnter a name for the logical volume (LV) being created.\n\nThis is similar to setting a label for a partition."
_lvmlvsize="\nEnter what size you want the logical volume (LV) to be in megabytes (M) or gigabytes (G).\n\ne.g. 100M will create a 100 megabyte volume, 10G will create a 10 gigabyte volume."
_lvmdelask="\nConfirm deletion of volume group(s) and logical volume(s).\n\nDeleting a volume group, will delete all logical volumes within it.\n"
# Errors
_errexpart="\nCannot mount partition due to a problem with the mountpoint.\n\nEnsure it begins with a slash (/) followed by at least one character.\n"
_errpart="\nYou need to create partition(s) first.\n\n\nBIOS systems require at least one partition (ROOT).\n\nUEFI systems require at least two (ROOT and EFI).\n"
_errchoice="\nIf you want to fix the issue yourself use Ctrl-z to pause the installer.\nFrom there you can do whatever is needed to resolve the error.\nOnce finished use the 'fg' command to resume the installer and select 'Continue'.\n"
_errvolname="\nInvalid name entered.\n\nThe volume name may be alpha-numeric, but may not contain spaces, start with a '/', or already be in use.\n"
_lukserr="\nA minimum of two partitions are required for LUKS encryption:\n\n 1. root (/) - standard or LVM.\n 2. boot (/boot) - standard (unless LVM on BIOS system).\n"
_lvmerr="\nThere are no available partitions to use for LVM, a minimum of one is required.\n\nIf LVM is already in use, deactivating it will allow the partition(s) to be used again.\n"
_lvmerrlvsize="\nInvalid value Entered.\n\nMust be a numeric value with 'M' (megabytes) or 'G' (gigabytes) at the end.\n\ne.g. 400M, 10G, 250G, etc...\n\nThe value may also not be equal to or greater than the remaining size of the volume group.\n"
# }
###############################################################################
# selection menus
# main is the entry point which calls functions including outside of its block
# once those functions finished they always are returned here with the
# exception of install_main(), it exits upon completion
main()
{
if [[ $NOMOUNT ]]; then
(( SEL < 8 )) && (( SEL++ ))
tput civis
dialog --backtitle "$DIST Schmedding Installer - $SYS - v$VER" --title " Prepare " \
--default-item $SEL --cancel-label 'Exit' --menu "$_prep" 0 0 0 \
1 "* Select bootloader" \
2 "* Username and password" \
3 "* System configuration" \
4 "Select WM(s) and/or DE(s)" \
5 "Select additional packages" \
6 "Enter a post-install command to run" \
7 "View installation configuration" \
8 "* Confirm choices and complete install" 2> "$ANS"
read -r SEL < "$ANS"
case $SEL in
1) prechecks 0 && { select_bootldr || (( SEL-- )); } ;;
2) prechecks 1 && { select_mkuser || (( SEL-- )); } ;;
3) prechecks 2 && { select_config || (( SEL-- )); } ;;
4) prechecks 3 && { select_sessions || (( SEL-- )); } ;;
5) prechecks 3 && { select_packages || (( SEL-- )); } ;;
6) prechecks 3 && select_usercmd ;;
7) prechecks 3 && select_show ;;
8) prechecks 3 && install_main ;;
*) yesno "Exit" "\nUnmount partitions (if any) and exit the installer?\n" && die 0
esac
else
(( SEL < 13 )) && (( SEL++ ))
tput civis
dialog --backtitle "$DIST Schmedding Installer - $SYS - v$VER" --title " Prepare " \
--default-item $SEL --cancel-label 'Exit' --menu "$_prep" 0 0 0 \
1 "Storage management" \
2 "* Mount partitions" \
3 "* Select bootloader" \
4 "* Username and password" \
5 "* System configuration" \
6 "Select WM(s) and/or DE(s)" \
7 "Select additional packages" \
8 "Enter a post-install command to run" \
9 "View installation configuration" \
10 "* Confirm choices and complete install" 2> "$ANS"
read -r SEL < "$ANS"
if [[ -z $WARN && $SEL == 2 ]]; then
msg "Data Warning" "$_warn"
WARN=true
fi
case $SEL in
1) dev_menu || (( SEL-- )) ;;
2) mount_menu || (( SEL-- )) ;;
3) prechecks 0 && { select_bootldr || (( SEL-- )); } ;;
4) prechecks 1 && { select_mkuser || (( SEL-- )); } ;;
5) prechecks 2 && { select_config || (( SEL-- )); } ;;
6) prechecks 3 && { select_sessions || (( SEL-- )); } ;;
7) prechecks 3 && { select_packages || (( SEL-- )); } ;;
8) prechecks 3 && select_usercmd ;;
9) prechecks 3 && select_show ;;
10) prechecks 3 && install_main ;;
*) yesno "Exit" "\nUnmount partitions (if any) and exit the installer?\n" && die 0
esac
fi
}
select_show()
{
local pkgs="${USER_PKGS[*]} ${SES_PKGS[*]}"
[[ $INSTALL_WMS == *dwm* ]] && pkgs="dwm st dmenu $pkgs"
pkgs="${pkgs// / }" pkgs="${pkgs# }"
msg "Show Configuration" "
---------- PARTITION CONFIGURATION ------------
Root Part: $ROOT - ${ROOTFS:-skipped}
Boot Part: ${BOOT:-none} - ${BOOTFS:-none}
Boot Device: ${BOOT_D:-none}
Swap Part/File: ${SWAP:-none}
Swap Size: ${SWAP_S:-none}
Extra Mounts: ${EXMNTS:-none}
Mkinit Hooks: ${HOOKS:-none}
LVM used: ${LVM:-unused}
LUKS used: ${LUKS:-unused}
------------ SYSTEM CONFIGURATION -------------
Locale: ${LOCALE:-none}
Keymap: ${KEYMAP:-none}
Hostname: ${NEWHOST:-none}
Timezone: ${ZONE:-none}/${SUBZ:-none}
Chroot cmd: ${USERCMD:-none}
------------ USER CONFIGURATION ---------------
Username: ${NEWUSER:-none}
Login Shell: ${NEWSHELL:-none}
Login Session: ${LOGIN_WM:-none}
Autologin: ${AUTOLOGIN:-none}
Login Type: ${LOGIN_TYPE:-none}
----------- PACKAGE CONFIGURATION -------------
Kernel: ${KERNEL:-none}
Bootloader: ${BOOTLDR:-none}
Packages: ${pkgs:-none}
"
}
select_login()
{
AUTOLOGIN=''
dlg LOGIN_TYPE menu "Login" "\nSelect what kind of login management to use." \
"xinit" "Console login with no graphical display manager" \
"lightdm" "Lightweight display manager (deepin and xfce default)" \
"gdm" "Gnome display manager (gnome default, go figure)" \
"sddm" "Simple desktop display manager (plasma and lxqt default)" || return 1
case $LOGIN_TYPE in
gdm)
EDIT_FILES[login]="none"
;;
sddm)
if [[ $INSTALL_WMS =~ (plasma|lxqt) ]]; then
EDIT_FILES[login]="/etc/sddm.conf.d/theme.conf"
else
EDIT_FILES[login]="none"
fi
;;
lightdm)
LIGHTDM_GREETER='gtk-greeter'
EDIT_FILES[login]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf"
local txt="\nWith a deepin install you can choose to use their greeter for lightdm\n\nUse the deepin greeter?\n"
[[ $INSTALL_WMS == *deepin* ]] && yesno "Greeter" "$txt" && LIGHTDM_GREETER="deepin-greeter"
;;
xinit)
EDIT_FILES[login]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.xprofile"
if (( $(wc -w <<< "$INSTALL_WMS") > 1 )); then
dlg LOGIN_WM menu "Session" "$_login" $LOGIN_CHOICES || return 1
LOGIN_WM="${WM_SESSIONS[$LOGIN_WM]}"
fi
[[ -z $LOGIN_WM ]] && LOGIN_WM="${WM_SESSIONS[${INSTALL_WMS%% *}]}"
yesno "Autologin" "$(sed "s|USER|$NEWUSER|g; s|RC|$LOGINRC|g" <<< "$_autologin")" && AUTOLOGIN=true
;;
esac
return 0
}
select_config()
{
typeset -i i=0
CONFIG_DONE=''
until [[ $CONFIG_DONE ]]; do
case $i in
0)
dlg NEWSHELL menu "Shell" "\nChoose which shell to use." \
zsh 'A very advanced and programmable command interpreter (shell) for UNIX' \
bash 'The GNU Bourne Again shell, standard in many GNU/Linux distributions' \
mksh 'The MirBSD Korn Shell - an enhanced version of the public domain ksh' || return 1
;;
1)
dlg NEWHOST input "Hostname" "$_hostname" "${DIST,,}" limit || { i=0; continue; }
;;
2)
dlg LOCALE menu "Locale" "$_locale" $LOCALES || { i=1; continue; }
;;
3)
ZONE='' SUBZ=''
until [[ $ZONE && $SUBZ ]]; do
dlg ZONE menu "Timezone" "$_timez" \
America - \
Australia - \
Asia - \
Atlantic - \
Africa - \
Europe - \
Indian - \
Pacific - \
Arctic - \
Antarctica - || break
dlg SUBZ menu "Timezone" "$_timesubz" $(awk '/'"$ZONE"'\// {
gsub(/'"$ZONE"'\//, "")
print $3 " - "
}' /usr/share/zoneinfo/zone.tab | sort) || continue
done
[[ $ZONE && $SUBZ ]] || { i=2; continue; }
;;
4)
dlg KERNEL menu "Kernel" "\nChoose which kernel to use." \
linux 'Vanilla linux kernel and modules, with a few patches applied' \
linux-lts 'Long-term support (LTS) linux kernel and modules' \
linux-zen 'A effort of kernel hackers to provide the best kernel for everyday systems' \
linux-hardened 'A security-focused linux kernel with hardening patches to mitigate exploits' || { i=3; continue; }
CONFIG_DONE=true
;;
esac
(( i++ )) # progress through to the next choice
done
case $NEWSHELL in
bash) LOGINRC='.bash_profile' ;;
zsh) LOGINRC='.zprofile' ;;
mksh) LOGINRC='.profile' ;;
esac
return 0
}
select_mkuser()
{
NEWUSER=''
typeset -a ans
local rootsec="--- Root password, if left empty the user password will be used ---"
until [[ $NEWUSER ]]; do
tput cnorm
dialog --insecure --backtitle "$DIST Schmedding Installer - $SYS - v$VER" \
--separator $'\n' --title " User " --mixedform "$_user" 0 0 0 \
"Username:" 1 1 "${ans[0]}" 1 11 "$COLUMNS" 0 0 \
"Password:" 2 1 '' 2 11 "$COLUMNS" 0 1 \
"Password2:" 3 1 '' 3 12 "$COLUMNS" 0 1 \
"$rootsec" 6 1 '' 6 68 "$COLUMNS" 0 2 \
"Password:" 8 1 '' 8 11 "$COLUMNS" 0 1 \
"Password2:" 9 1 '' 9 12 "$COLUMNS" 0 1 2> "$ANS" || return 1
mapfile -t ans <"$ANS"
# root passwords empty, so use the user passwords
if [[ -z "${ans[4]}" && -z "${ans[5]}" ]]; then
ans[4]="${ans[1]}"
ans[5]="${ans[2]}"
fi
# make sure a username was entered and that the passwords match
if [[ -z ${ans[0]} || ${ans[0]} =~ \ |\' || ${ans[0]} =~ [^a-z0-9] ]]; then
msg "Invalid Username" "\nInvalid user name.\n\nPlease try again.\n"; ans[0]=''
elif [[ -z "${ans[1]}" || "${ans[1]}" != "${ans[2]}" ]]; then
msg "Password Mismatch" "\nThe user passwords do not match.\n\nPlease try again.\n"
elif [[ "${ans[4]}" != "${ans[5]}" ]]; then
msg "Password Mismatch" "\nThe root passwords do not match.\n\nPlease try again.\n"
else
NEWUSER="${ans[0]}"
USER_PASS="${ans[1]}"
ROOT_PASS="${ans[4]}"
fi
done
return 0
}
select_keymap()
{
if [[ ! -f /tmp/xkeys ]]; then
dlg KEYMAP menu "Keyboard" "$_keymap" \
af Afghani al Albanian am Armenian ara Arabic at German au English \
az Azerbaijani ba Bosnian bd Bangla be Belgian 'bg' Bulgarian br Portuguese \
bt Dzongkha bw Tswana by Belarusian ca French 'cd' French ch German \
cm English cn Chinese cz Czech de German dk Danish dz Berber \
ee Estonian epo Esperanto es Spanish et Amharic 'fi' Finnish fo Faroese \
fr French gb English ge Georgian gh English gn French gr Greek \
hr Croatian hu Hungarian id Indonesian ie Irish il Hebrew 'in' Indian \
iq Iraqi ir Persian is Icelandic it Italian jp Japanese ke Swahili \
kg Kyrgyz kh Khmer kr Korean kz Kazakh la Lao latam Spanish \
lk Sinhala lt Lithuanian lv Latvian ma Arabic mao Maori md Moldavian \
me Montenegrin mk Macedonian ml Bambara mm Burmese mn Mongolian mt Maltese \
'mv' Dhivehi my Malay ng English nl Dutch no Norwegian np Nepali \
ph Filipino pk Urdu pl Polish pt Portuguese ro Romanian rs Serbian \
ru Russian se Swedish si Slovenian sk Slovak sn Wolof sy Arabic \
tg French th Thai tj Tajik tm Turkmen tr Turkish tw Taiwanese \
tz Swahili ua Ukrainian us English uz Uzbek vn Vietnamese za English || return 1
echo "$KEYMAP" > /tmp/xkeys
else
KEYMAP="$(< /tmp/xkeys)"
: "${KEYMAP='us'}"
fi
if [[ ! -f /tmp/ckeys ]]; then
if [[ $CMAPS == *"$KEYMAP "* ]]; then
CMAP="$KEYMAP"
else
dlg CMAP menu "Console Keymap" "$_vconsole" $CMAPS || return 1
fi
echo "$CMAP" > /tmp/ckeys
else
CMAP="$(< /tmp/ckeys)"
: "${CMAP='us'}"
fi
if [[ $TERM == 'linux' ]]; then
loadkeys "$CMAP" > /dev/null 2>&1
else
setxkbmap "$KEYMAP" > /dev/null 2>&1
fi
return 0
}
select_usercmd()
{
dlg USERCMD input "Command" "$_usercmd" "$USERCMD" nolimit
}
select_mirrors()
{
codes=''
MIRROR_URL=''
typeset -ga MIRROR_COUNTRY
typeset c=""
while :; do
c=""
dlg codes check "Mirror Countries" "\nSelect which countries to use mirrors from.\n\nNot choosing any will result in an automatic selection." \
AU Australia "$(ofn AU "$codes")" AT Austria "$(ofn AT "$codes")" \
BA "Bosnia Herzegovina" "$(ofn BA "$codes")" BY Belarus "$(ofn BY "$codes")" \
BE Belgium "$(ofn BE "$codes")" BR Brazil "$(ofn BR "$codes")" \
BG Bulgaria "$(ofn BG "$codes")" CA Canada "$(ofn CA "$codes")" \
CL Chile "$(ofn CL "$codes")" CN China "$(ofn CN "$codes")" \
CO Colombia "$(ofn CO "$codes")" CZ "Czech Republic" "$(ofn CZ "$codes")" \
DK Denmark "$(ofn DK "$codes")" EE Estonia "$(ofn EE "$codes")" \
FI Finland "$(ofn FI "$codes")" FR France "$(ofn FR "$codes")" \
DE Germany "$(ofn DE "$codes")" GB "United Kingdom" "$(ofn GB "$codes")" \
GR Greece "$(ofn GR "$codes")" HU Hungary "$(ofn HU "$codes")" \
IN India "$(ofn IN "$codes")" IE Ireland "$(ofn IE "$codes")" \
IL Israel "$(ofn IL "$codes")" IT Italy "$(ofn IT "$codes")" \
JP Japan "$(ofn JP "$codes")" KZ Kazakhstan "$(ofn KZ "$codes")" \
KR Korea "$(ofn KR "$codes")" LT Lithuania "$(ofn LT "$codes")" \
LV Latvia "$(ofn LV "$codes")" LU Luxembourg "$(ofn LU "$codes")" \
MK Macedonia "$(ofn MK "$codes")" NL Netherlands "$(ofn NL "$codes")" \
NC "New Caledonia" "$(ofn NC "$codes")" NZ "New Zealand" "$(ofn NZ "$codes")" \
NO Norway "$(ofn NO "$codes")" PL Poland "$(ofn PL "$codes")" \
PT Portugal "$(ofn PT "$codes")" RO Romania "$(ofn RO "$codes")" \
RU Russia "$(ofn RU "$codes")" RS Serbia "$(ofn RS "$codes")" \
SG Singapore "$(ofn SG "$codes")" SK Slovakia "$(ofn SK "$codes")" \
ZA "South Africa" "$(ofn ZA "$codes")" ES Spain "$(ofn ES "$codes")" \
LK "Sri Lanka" "$(ofn LK "$codes")" SE Sweden "$(ofn SE "$codes")" \
CH Switzerland "$(ofn CH "$codes")" TW Taiwan "$(ofn TW "$codes")" \
TR Turkey "$(ofn TR "$codes")" UA Ukraine "$(ofn UA "$codes")" \
US "United States" "$(ofn US "$codes")" UZ Uzbekistan "$(ofn UZ "$codes")" \
VN Vietnam "$(ofn VN "$codes")" || return 1
for i in $codes; do
if [[ $c ]]; then
c+=", ${COUNTRIES[$i]}"
else
c="${COUNTRIES[$i]}"
fi
done
yesno "Mirror Countries" "\nConfirm the following countries: $c\n" && break
done
for i in $codes; do
if [[ $MIRROR_URL ]]; then
MIRROR_URL+="&country=$i"
else
MIRROR_URL="https://www.archlinux.org/mirrorlist/?country=$i"
fi
MIRROR_COUNTRY+=("--country" "${COUNTRIES[$i]}")
done
MIRROR_URL+='&use_mirror_status=on'
return 0
}
select_bootldr()
{
if [[ $SYS == 'BIOS' ]]; then
dlg BOOTLDR menu "BIOS Bootloader" "\nSelect which bootloader to use." \
"grub" "The Grand Unified Bootloader, standard among many Linux distributions" \
"syslinux" "A collection of boot loaders for booting drives, CDs, or over the network" || return 1
else
dlg BOOTLDR menu "UEFI Bootloader" "\nSelect which bootloader to use." \
"systemd-boot" "A simple UEFI boot manager which executes configured EFI images" \
"grub" "The Grand Unified Bootloader, standard among many Linux distributions" \
"refind-efi" "A UEFI boot manager that aims to be platform neutral and simplify multi-boot" \
"efistub" "Boot the kernel image directly (no chainloading support)" \
"syslinux" "A collection of boot loaders for booting drives, CDs, or over the network (no chainloading support)" || return 1
fi
setup_${BOOTLDR}
return 0
}
select_sessions()
{
typeset -a pkgs
LOGIN_CHOICES=''
dlg INSTALL_WMS check "Sessions" "$_sessions\n" \
i3-gaps "A fork of i3wm with more features including gaps" "$(ofn i3-gaps "$INSTALL_WMS")" \
openbox "A lightweight, powerful, and highly configurable stacking wm" "$(ofn openbox "$INSTALL_WMS")" \
dwm "A dynamic WM for X that manages windows in tiled, floating, or monocle layouts" "$(ofn dwm "$INSTALL_WMS")" \
bspwm "A tiling wm that represents windows as the leaves of a binary tree" "$(ofn bspwm "$INSTALL_WMS")" \
lxqt "A port of the lightweight desktop environment (LXDE) to Qt" "$(ofn lxqt "$INSTALL_WMS")" \
jwm "A lightweight window manager for Xorg written in C" "$(ofn jwm "$INSTALL_WMS")" \
xfce4 "A lightweight and modular desktop environment based on gtk+2/3" "$(ofn xfce4 "$INSTALL_WMS")" \
awesome "A customized Awesome WM session created by @elanapan" "$(ofn awesome "$INSTALL_WMS")" \
fluxbox "A lightweight and highly-configurable window manager" "$(ofn fluxbox "$INSTALL_WMS")" \
plasma "A KDE software project currently comprising a full desktop environment" "$(ofn plasma "$INSTALL_WMS")" \
deepin "The desktop environment of the Chinese Deepin Linux distribution." "$(ofn deepin "$INSTALL_WMS")" \
gnome "A desktop environment that aims to be simple and easy to use" "$(ofn gnome "$INSTALL_WMS")" \
cinnamon "A desktop environment combining traditional desktop with modern effects" "$(ofn cinnamon "$INSTALL_WMS")"
[[ $INSTALL_WMS ]] || return 0
for i in ${INSTALL_WMS/dwm/}; do
pkgs+=("$i")
done
for i in $INSTALL_WMS; do
LOGIN_CHOICES+="$i - "
if [[ $i =~ (plasma|deepin) ]]; then
local pretxt="\nThere are some extra packages available for $i that can be installed:"
local txt="These are larger package groups containing applications that are a part of $i"
txt+=" but are not included in the $i package group."
yesno "${i^} Extra" "$pretxt ${WM_EXT[$i]}\n\n$txt\n\nWould you like to install them?\n" || continue
fi
if [[ ${WM_EXT[$i]} ]]; then
for j in ${WM_EXT[$i]}; do
pkgs+=("$j")
done
fi
done
select_login || return 1
for pkg in "${pkgs[@]}"; do
[[ ${SES_PKGS[*]} != *"$pkg"* ]] && SES_PKGS+=("$pkg")
done
if [[ $INSTALL_WMS ]]; then
echo "$INSTALL_WMS" > /tmp/wmlist
else
rm -f /tmp/wmlist
fi
return 0
}
select_packages()
{
dlg UPKGS check " Packages " "$_packages" \
abiword "A Fully-featured word processor" "$(ofn abiword "${USER_PKGS[*]}")" \
alacritty "A cross-platform, GPU-accelerated terminal emulator" "$(ofn alacritty "${USER_PKGS[*]}")" \
atom "An open-source text editor developed by GitHub" "$(ofn atom "${USER_PKGS[*]}")" \
audacious "A free and advanced audio player based on GTK+" "$(ofn audacious "${USER_PKGS[*]}")" \
audacity "A program that lets you manipulate digital audio waveforms" "$(ofn audacity "${USER_PKGS[*]}")" \
base-devel "A group of packages required for AUR" "$(ofn base-devel "${USER_PKGS[*]}")" \
blueman "GUI bluetooth device manager" "$(ofn blueman "${USER_PKGS[*]}")" \
bluez "Simple CLI based bluetooth support" "$(ofn bluez "${USER_PKGS[*]}")" \
cairo-dock "Light eye-candy fully themable animated dock" "$(ofn cairo-dock "${USER_PKGS[*]}")" \
calligra "A set of applications for productivity" "$(ofn calligra "${USER_PKGS[*]}")" \
chromium "An open-source web browser based on the Blink rendering engine" "$(ofn chromium "${USER_PKGS[*]}")" \
clementine "A modern music player and library organizer" "$(ofn clementine "${USER_PKGS[*]}")" \
cmus "A small, fast and powerful console music player" "$(ofn cmus "${USER_PKGS[*]}")" \
deadbeef "A GTK+ audio player for GNU/Linux" "$(ofn deadbeef "${USER_PKGS[*]}")" \
deluge "A bittorrent client written in python" "$(ofn deluge "${USER_PKGS[*]}")" \
elinks "An advanced and well-established feature-rich text mode web browser" "$(ofn elinks "${USER_PKGS[*]}")" \
emacs "An extensible, customizable, self-documenting real-time display editor" "$(ofn emacs "${USER_PKGS[*]}")" \
epiphany "A GNOME web browser based on the WebKit rendering engine" "$(ofn epiphany "${USER_PKGS[*]}")" \
evince "A document viewer" "$(ofn evince "${USER_PKGS[*]}")" \
evolution "Manage your email, contacts and schedule" "$(ofn evolution "${USER_PKGS[*]}")" \
file-roller "Create and modify archives" "$(ofn file-roller "${USER_PKGS[*]}")" \
firefox "A popular open-source web browser from Mozilla" "$(ofn firefox "${USER_PKGS[*]}")" \
gcolor2 "A simple GTK+2 color selector" "$(ofn gcolor2 "${USER_PKGS[*]}")" \
geany "A fast and lightweight IDE" "$(ofn geany "${USER_PKGS[*]}")" \
geary "A lightweight email client for the GNOME desktop" "$(ofn geary "${USER_PKGS[*]}")" \
gimp "GNU Image Manipulation Program" "$(ofn gimp "${USER_PKGS[*]}")" \
git "The fast distributed version control system" "$(ofn git "${USER_PKGS[*]}")" \
gnome-calculator "GNOME Scientific calculator" "$(ofn gnome-calculator "${USER_PKGS[*]}")" \
gnome-disk-utility "Disk Management Utility" "$(ofn gnome-disk-utility "${USER_PKGS[*]}")" \
gnome-system-monitor "View current processes and monitor system state" "$(ofn gnome-system-monitor "${USER_PKGS[*]}")" \
gparted "A GUI frontend for creating and manipulating partition tables" "$(ofn gparted "${USER_PKGS[*]}")" \
gpick "Advanced color picker using GTK+ toolkit" "$(ofn gpick "${USER_PKGS[*]}")" \
gpicview "Lightweight image viewer" "$(ofn gpicview "${USER_PKGS[*]}")" \
guvcview "Capture video from camera devices" "$(ofn guvcview "${USER_PKGS[*]}")" \
hexchat "A popular and easy to use graphical IRC client" "$(ofn hexchat "${USER_PKGS[*]}")" \
htop "An interactive process viewer" "$(ofn htop "${USER_PKGS[*]}")" \
inkscape "Professional vector graphics editor" "$(ofn inkscape "${USER_PKGS[*]}")" \
irssi "A modular text mode IRC client with Perl scripting" "$(ofn irssi "${USER_PKGS[*]}")" \
kdenlive "A popular non-linear video editor for Linux" "$(ofn kdenlive "${USER_PKGS[*]}")" \
krita "Edit and paint images" "$(ofn krita "${USER_PKGS[*]}")" \
libreoffice-fresh "Full featured office suite" "$(ofn libreoffice-fresh "${USER_PKGS[*]}")" \
lollypop "A new music playing application" "$(ofn lollypop "${USER_PKGS[*]}")" \
mc "A file manager that imitates Norton Commander" "$(ofn mc "${USER_PKGS[*]}")" \
mousepad "A simple text editor" "$(ofn mousepad "${USER_PKGS[*]}")" \
mpd "A flexible, powerful, server-side application for playing music" "$(ofn mpd "${USER_PKGS[*]}")" \
mpv "A media player based on mplayer" "$(ofn mpv "${USER_PKGS[*]}")" \
mupdf "Lightweight PDF and XPS viewer" "$(ofn mupdf "${USER_PKGS[*]}")" \
mutt "Small but very powerful text-based mail client" "$(ofn mutt "${USER_PKGS[*]}")" \
nano "Pico editor clone with enhancements" "$(ofn nano "${USER_PKGS[*]}")" \
nautilus "The default file manager for Gnome" "$(ofn nautilus "${USER_PKGS[*]}")" \
ncmpcpp "A mpd client and almost exact clone of ncmpc with some new features" "$(ofn ncmpcpp "${USER_PKGS[*]}")" \
neovim "A fork of Vim aiming to improve user experience, plugins, and GUIs." "$(ofn neovim "${USER_PKGS[*]}")" \
nmap "Utility for network discovery and security auditing" "$(ofn nmap "${USER_PKGS[*]}")" \
noto-fonts "Google Noto fonts" "$(ofn noto-fonts "${USER_PKGS[*]}")" \
noto-fonts-cjk "Google Noto CJK fonts (Chinese, Japanese, Korean)" "$(ofn noto-fonts-cjk "${USER_PKGS[*]}")" \
ntfs-3g "NTFS file system driver and utilities" "$(ofn ntfs-3g "${USER_PKGS[*]}")" \
obs-studio "Free opensource streaming/recording software" "$(ofn obs-studio "${USER_PKGS[*]}")" \
openshot "An open-source, non-linear video editor for Linux" "$(ofn openshot "${USER_PKGS[*]}")" \
opera "A Fast and secure, free of charge web browser from Opera Software" "$(ofn opera "${USER_PKGS[*]}")" \
pcmanfm "A fast and lightweight file manager based in Lxde" "$(ofn pcmanfm "${USER_PKGS[*]}")" \
pidgin "Multi-protocol instant messaging client" "$(ofn pidgin "${USER_PKGS[*]}")" \
plank "An elegant, simple, and clean dock" "$(ofn plank "${USER_PKGS[*]}")" \
playerctl "Media player controller for spotify, vlc, audacious, bmp, xmms2, and others." "$(ofn playerctl "${USER_PKGS[*]}")" \
qbittorrent "An advanced bittorrent client" "$(ofn qbittorrent "${USER_PKGS[*]}")" \
qpdfview "A tabbed PDF viewer" "$(ofn qpdfview "${USER_PKGS[*]}")" \
qt5ct "GUI for managing Qt based application themes, icons, and fonts" "$(ofn qt5ct "${USER_PKGS[*]}")" \
qutebrowser "A keyboard-focused vim-like web browser based on Python and PyQt5" "$(ofn qutebrowser "${USER_PKGS[*]}")" \
rhythmbox "A Music playback and management application" "$(ofn rhythmbox "${USER_PKGS[*]}")" \
rsync "A file transfer program to keep remote files in sync" "$(ofn rsync "${USER_PKGS[*]}")" \
rxvt-unicode "A unicode enabled rxvt-clone terminal emulator" "$(ofn rxvt-unicode "${USER_PKGS[*]}")" \
sakura "A terminal emulator based on GTK and VTE" "$(ofn sakura "${USER_PKGS[*]}")" \
simple-scan "Simple scanning utility" "$(ofn simple-scan "${USER_PKGS[*]}")" \
simplescreenrecorder "A feature-rich screen recorder" "$(ofn simplescreenrecorder "${USER_PKGS[*]}")" \
steam "A popular game distribution platform by Valve" "$(ofn steam "${USER_PKGS[*]}")" \
surf "A simple web browser based on WebKit2/GTK+" "$(ofn surf "${USER_PKGS[*]}")" \
terminator "Terminal emulator that supports tabs and grids" "$(ofn terminator "${USER_PKGS[*]}")" \
termite "A minimal VTE-based terminal emulator" "$(ofn termite "${USER_PKGS[*]}")" \
thunar "A modern file manager for the Xfce Desktop Environment" "$(ofn thunar "${USER_PKGS[*]}")" \
thunderbird "Standalone mail and news reader from mozilla" "$(ofn thunderbird "${USER_PKGS[*]}")" \
tilda "A GTK based drop down terminal for Linux and Unix" "$(ofn tilda "${USER_PKGS[*]}")" \
tilix "A tiling terminal emulator for Linux using GTK+ 3" "$(ofn tilix "${USER_PKGS[*]}")" \
transmission-cli "Free bittorrent client CLI" "$(ofn transmission-cli "${USER_PKGS[*]}")" \
unrar "The RAR compression program" "$(ofn unrar "${USER_PKGS[*]}")" \
transmission-gtk "GTK+ Front end for transmission" "$(ofn transmission-gtk "${USER_PKGS[*]}")" \
transmission-qt "Qt Front end for transmission" "$(ofn transmission-qt "${USER_PKGS[*]}")" \
ttf-anonymous-pro "A family fixed-width fonts designed with code in mind" "$(ofn ttf-anonymous-pro "${USER_PKGS[*]}")" \
ttf-fira-code "Monospaced font with programming ligatures" "$(ofn ttf-fira-code "${USER_PKGS[*]}")" \
ttf-font-awesome "Iconic font designed for Bootstrap" "$(ofn ttf-font-awesome "${USER_PKGS[*]}")" \
ttf-hack "A hand groomed typeface based on Bitstream Vera Mono" "$(ofn ttf-hack "${USER_PKGS[*]}")" \
vim "Vi Improved, a highly configurable, improved version of the vi text editor" "$(ofn vim "${USER_PKGS[*]}")" \
vlc "A free and open source cross-platform multimedia player" "$(ofn vlc "${USER_PKGS[*]}")" \
weechat "Fast, light and extensible IRC client" "$(ofn weechat "${USER_PKGS[*]}")" \
wget "Network utility to retrieve files from the Web" "$(ofn wget "${USER_PKGS[*]}")" \
xapps "Common library for X-Apps project" "$(ofn xapps "${USER_PKGS[*]}")" \
xarchiver "A GTK+ frontend to various command line archivers" "$(ofn xarchiver "${USER_PKGS[*]}")" \
xed "A small and lightweight text editor. X-Apps Project." "$(ofn xed "${USER_PKGS[*]}")" \
xfce4-terminal "A terminal emulator based in the Xfce Desktop Environment" "$(ofn xfce4-terminal "${USER_PKGS[*]}")" \
xreader "Document viewer for files like PDF and Postscript. X-Apps Project." "$(ofn xed "${USER_PKGS[*]}")" \
zathura "Minimalistic document viewer" "$(ofn zathura "${USER_PKGS[*]}")"
if [[ $UPKGS ]]; then # add any needed PKG_EXT to the list
for i in $UPKGS; do
[[ ${USER_PKGS[*]} != *"$i"* ]] && USER_PKGS+=("$i")
if [[ ${PKG_EXT[$i]} ]]; then
for j in ${PKG_EXT[$i]}; do
[[ ${USER_PKGS[*]} != *"$j"* ]] && USER_PKGS+=("$j")
done
fi
done
fi
return 0
}
###############################################################################
# device management menus
# acts as an in-between function to avoid cluttering the main menu
# also called when mounting but not enough partitions are present
dev_menu()
{
local txt="$1"
local choice=''
local back="Return to the main menu"
[[ $txt ]] && back="Return to mounting"
while :; do
dlg choice menu "Device Management" \
"\nHere you can perform some operations to modify system storage devices.\nSelect an option from the list below to see more.\n$txt" \
'view' 'View the device tree output from lsblk' \
'part' 'Modify the partition layout of a device' \
'luks' 'Setup LUKS encryption on a partition or LVM' \
'lvm' 'Setup logical volume management on partition(s)' \
'back' "$back"
if [[ -z $WARN && $choice != 'view' ]]; then
msg "Data Warning" "$_warn"
WARN=true
fi
case "$choice" in
'view') part_show ;;
'part') part_menu && [[ "$AUTO_ROOT" ]] && return 0 ;;
'luks') luks_menu || return 1 ;;
'lvm') lvm_menu || return 1 ;;
*) break;
esac
done
return 0
}
###############################################################################
# partitioning menu
# non-essential partitioning helpers called by the user when using the optional
# partition menu and selecting a device to edit
part_menu()
{
local device choice devhash