Use less custom buttons for yesno dialogs

This commit is contained in:
natemaia 2019-01-18 21:08:05 -08:00
parent d6a53203ab
commit 5c8bd58dfc
2 changed files with 118 additions and 131 deletions

View File

@ -25,8 +25,8 @@ _NoNetwork="\nThis installer needs to be run with an active internet connection
# Preparation Menu # Preparation Menu
_PrepTitle="Prep for Install" _PrepTitle="Prep for Install"
_PrepBody="\nThis is the menu in which you will prepare your system for the install.\n\nTo begin the install you must first have:\n\n - A root (/) partition mounted (UEFI systems also require a seperate boot partition).\n - A user created and the passwords set.\n - The system settings configured." _PrepBody="\nThis is the menu in which you will prepare your system for the install.\n\nTo begin the install you must first have:\n\n - A root (/) partition mounted (UEFI systems also require a seperate boot partition).\n - A user created and the passwords set.\n - The system settings configured."
_PrepLayout="Select keyboard layout" _PrepLayout="Keyboard Layout"
_PrepShowDev="Show device tree (optional)" _PrepShowDev="Show lsblk output (optional)"
_PrepParts="Edit partitions (optional)" _PrepParts="Edit partitions (optional)"
_PrepLUKS="LUKS encryption (optional)" _PrepLUKS="LUKS encryption (optional)"
_PrepLVM="Logical volume management (optional)" _PrepLVM="Logical volume management (optional)"
@ -79,7 +79,7 @@ _WMLoginBody="\nSelect which to use as your primary login session.\n\nThis can b
# Set keymap, hwclock, local and timezone # Set keymap, hwclock, local and timezone
_CMapTitle="Console Keymap" _CMapTitle="Console Keymap"
_CMapBody="\nSelect console keymap, the console is the tty shell you reach before starting a graphical environment (usually Xorg).\n\nIts keymap is seperate from the one used by the graphical environments, though many do use the same such as 'us' English.\n\nDefault: us" _CMapBody="\nSelect console keymap, the console is the tty shell you reach before starting a graphical environment (usually Xorg).\n\nIts keymap is seperate from the one used by the graphical environments, though many do use the same such as 'us' English.\n\nDefault: us"
_XMapBody="\nPick your system keymap from the list below\n\nThis keymap layout is used once a graphical environment is running (usually Xorg).\n\nIf a matching console keymap exists it will be used, otherwise you will be asked to select one for that as well.\n\nDefault: us" _XMapBody="\nPick your system keymap from the list below\n\nThis is the keymap used once a graphical environment is running (usually Xorg). If a matching console keymap exists it will be used, otherwise you will be asked to select one for that as well.\n\nDefault: us"
_LocaleBody="\nLocale determines the system language and currency formats.\n\nThe format for locale names is languagecode_COUNTRYCODE\n\neg. en_US is: english United States\n en_GB is: english Great Britain" _LocaleBody="\nLocale determines the system language and currency formats.\n\nThe format for locale names is languagecode_COUNTRYCODE\n\neg. en_US is: english United States\n en_GB is: english Great Britain"
# Configure # Configure
@ -124,7 +124,7 @@ _PartTitle="Partitioning"
_PartWipe="Secure Wipe" _PartWipe="Secure Wipe"
_PartAuto="Automatic Partitioning" _PartAuto="Automatic Partitioning"
_PartShowTree="Show Partition Table" _PartShowTree="Show Partition Table"
_PartBody="\nFull device auto partitioning is available for beginners.\n\nUEFI systems require a vfat/fat32 partition between 100-512M in size to be mounted at /boot or /boot/efi, BIOS systems using LUKS will also require this but formatted as ext3 or ext4 instead." _PartBody="\nFull device auto partitioning is available for beginners otherwise cfdisk is recommended.\n\n - UEFI systems require a vfat/fat32 partition between 100-512M in size to be mounted at /boot or /boot/efi\n - BIOS systems using LUKS will also require this but it does NOT require vfat/fat32 formatting."
# Auto partition # Auto partition
_PartBody1="\nWARNING:\n\nALL data on" _PartBody1="\nWARNING:\n\nALL data on"

View File

@ -215,10 +215,7 @@ declare -A FS_OPTS=(
main() main()
{ {
if [[ $MENU != 'main' ]]; then [[ $SEL ]] || SEL=0
MENU='main'
[[ $SAVED ]] && { SEL=$SAVED; unset SAVED; } || SEL=0
fi
(( SEL < 11 )) && (( SEL++ )) (( SEL < 11 )) && (( SEL++ ))
tput civis tput civis
@ -238,23 +235,22 @@ main()
"11" "$_PrepInstall") "11" "$_PrepInstall")
if [[ $WARN != true && $SEL =~ (2|5) ]]; then if [[ $WARN != true && $SEL =~ (2|5) ]]; then
WARN=true WARN=true; msgbox "$_PrepTitle" "$_WarnMount"
msgbox "$_PrepTitle" "$_WarnMount"
fi fi
case $SEL in case $SEL in
1) device_tree ;; 1) device_tree ;;
2) partition || SEL=$((SEL - 1)) ;; 2) partition || (( SEL-- )) ;;
3) luks_menu || SEL=$((SEL - 1)) ;; 3) luks_menu || (( SEL-- )) ;;
4) lvm_menu || SEL=$((SEL - 1)) ;; 4) lvm_menu || (( SEL-- )) ;;
5) mnt_menu || SEL=$((SEL - 1)) ;; 5) mnt_menu || (( SEL-- )) ;;
6) prechecks 0 && { mkuser || SEL=$((SEL - 1)); } ;; 6) prechecks 0 && { mkuser || (( SEL-- )); } ;;
7) prechecks 1 && { cfg_menu || SEL=$((SEL - 1)); } ;; 7) prechecks 1 && { cfg_menu || (( SEL-- )); } ;;
8) prechecks 2 && { select_sessions || SEL=$((SEL - 1)); } ;; 8) prechecks 2 && { select_sessions || (( SEL-- )); } ;;
9) prechecks 2 && { select_packages || SEL=$((SEL - 1)); } ;; 9) prechecks 2 && { select_packages || (( SEL-- )); } ;;
10) prechecks 2 && show_cfg ;; 10) prechecks 2 && show_cfg ;;
11) prechecks 2 && install ;; 11) prechecks 2 && install ;;
*) yesno "$_CloseInst" "$_CloseInstBody" "Exit" "Back" && die *) yesno "$_CloseInst" "$_CloseInstBody" && die
esac esac
} }
@ -267,7 +263,7 @@ show_cfg()
local mnt="${BMNTS[$SYS-$BOOTLDR]}" local mnt="${BMNTS[$SYS-$BOOTLDR]}"
local pkgs="${USER_PKGS# } ${PACKAGES# } $BASE_PKGS" local pkgs="${USER_PKGS# } ${PACKAGES# } $BASE_PKGS"
[[ $PACKAGES =~ (openbox|bspwm|i3-gaps) || $INSTALL_WMS == *dwm* ]] && pkgs="${pkgs# } $WM_BASE_PKGS" [[ $PACKAGES =~ (openbox|bspwm|i3-gaps) || $INSTALL_WMS == *dwm* ]] && pkgs="${pkgs# } $WM_BASE_PKGS"
[[ $INSTALL_WMS == *dwm* ]] && pkgs="${pkgs# } dwm st dmenu" [[ $INSTALL_WMS == *dwm* ]] && pkgs="dwm st dmenu ${pkgs# }"
pkgs="${pkgs# }" pkgs="${pkgs# }"
pkgs="${pkgs% }" pkgs="${pkgs% }"
msgbox "$_PrepTitle" " msgbox "$_PrepTitle" "
@ -536,7 +532,7 @@ select_mirrorcmd()
if hash reflector >/dev/null 2>&1; then if hash reflector >/dev/null 2>&1; then
MIRROR_CMD="reflector --score 100 -l 50 -f 5 --sort rate --verbose" MIRROR_CMD="reflector --score 100 -l 50 -f 5 --sort rate --verbose"
yesno "$_MirrorTitle" "$_MirrorSetup" "Automatic" "Custom" && return 0 yesno "$_MirrorTitle" "$_MirrorSetup" && return 0
c="$(json 'country_name' "$(json 'ip' "check&?access_key=${key}&fields=ip")?access_key=${key}&fields=country_name")" c="$(json 'country_name' "$(json 'ip' "check&?access_key=${key}&fields=ip")?access_key=${key}&fields=country_name")"
MIRROR_CMD="reflector --country $c --fastest 5 --sort rate --verbose" MIRROR_CMD="reflector --country $c --fastest 5 --sort rate --verbose"
@ -620,7 +616,8 @@ select_packages()
tput civis tput civis
cur=$(dialog --cr-wrap --stdout --backtitle "$BT" \ cur=$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_Packages " --default-item $cur --menu "$_PackageMenu" 0 0 0 \ --title " $_Packages " --default-item $cur \
--menu "$_PackageMenu" 0 0 0 \
1 "Web Browsers" \ 1 "Web Browsers" \
2 "Text Editors" \ 2 "Text Editors" \
3 "File Managers" \ 3 "File Managers" \
@ -637,7 +634,7 @@ select_packages()
[[ $cur && $cur -lt 13 ]] || break [[ $cur && $cur -lt 13 ]] || break
case $SEL in case $cur in
1) BROWSE_PKGS="$(select_browsers)" ;; 1) BROWSE_PKGS="$(select_browsers)" ;;
2) EDIT_PKGS="$(select_editors)" ;; 2) EDIT_PKGS="$(select_editors)" ;;
3) FM_PKGS="$(select_files)" ;; 3) FM_PKGS="$(select_files)" ;;
@ -659,7 +656,7 @@ select_packages()
USER_PKGS+="$PROF_PKGS $VIEW_PKGS $FNT_PKGS $TOR_PKGS $SYS_PKGS $EX_PKGS" USER_PKGS+="$PROF_PKGS $VIEW_PKGS $FNT_PKGS $TOR_PKGS $SYS_PKGS $EX_PKGS"
for i in $USER_PKGS; do for i in $USER_PKGS; do
[[ ${PKG_EXT[$i]} && $USER_PKGS != *${PKG_EXT[$i]}* ]] && USER_PKGS+=" ${PKG_EXT[$i]}" [[ ${PKG_EXT[$i]} && $USER_PKGS != *"${PKG_EXT[$i]}"* ]] && USER_PKGS+=" ${PKG_EXT[$i]}"
done done
USER_PKGS="${USER_PKGS// / }" USER_PKGS="${USER_PKGS// / }"
@ -671,12 +668,12 @@ select_browsers()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"firefox" "A popular open-source graphical web browser from Mozilla" $(offon 'firefox') \ "firefox" "A popular open-source graphical web browser from Mozilla" $(ofn 'firefox') \
"chromium" "an open-source graphical web browser based on the Blink rendering engine" $(offon 'chromium') \ "chromium" "an open-source graphical web browser based on the Blink rendering engine" $(ofn 'chromium') \
"opera" "A Fast and secure, free of charge web browser from Opera Software" $(offon 'opera') \ "opera" "A Fast and secure, free of charge web browser from Opera Software" $(ofn 'opera') \
"epiphany" "A GNOME web browser based on the WebKit rendering engine" $(offon 'epiphany') \ "epiphany" "A GNOME web browser based on the WebKit rendering engine" $(ofn 'epiphany') \
"surf" "A simple web browser based on WebKit2/GTK+" $(offon 'surf') \ "surf" "A simple web browser based on WebKit2/GTK+" $(ofn 'surf') \
"qutebrowser" "A keyboard-focused vim-like web browser based on Python and PyQt5" $(offon 'qutebrowser'))" "qutebrowser" "A keyboard-focused vim-like web browser based on Python and PyQt5" $(ofn 'qutebrowser'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -684,11 +681,11 @@ select_editors()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"neovim" "A fork of Vim aiming to improve user experience, plugins, and GUIs." $(offon 'neovim') \ "neovim" "A fork of Vim aiming to improve user experience, plugins, and GUIs." $(ofn 'neovim') \
"atom" "An open-source text editor developed by GitHub that is licensed under the MIT License" $(offon 'atom') \ "atom" "An open-source text editor developed by GitHub that is licensed under the MIT License" $(ofn 'atom') \
"geany" "A fast and lightweight IDE" $(offon 'geany') \ "geany" "A fast and lightweight IDE" $(ofn 'geany') \
"emacs" "An extensible, customizable, self-documenting real-time display editor" $(offon 'emacs') \ "emacs" "An extensible, customizable, self-documenting real-time display editor" $(ofn 'emacs') \
"mousepad" "A simple text editor" $(offon 'mousepad'))" "mousepad" "A simple text editor" $(ofn 'mousepad'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -696,12 +693,12 @@ select_files()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"thunar" "A modern file manager for the Xfce Desktop Environment" $(offon 'thunar') \ "thunar" "A modern file manager for the Xfce Desktop Environment" $(ofn 'thunar') \
"pcmanfm" "A fast and lightweight file manager based in Lxde" $(offon 'pcmanfm') \ "pcmanfm" "A fast and lightweight file manager based in Lxde" $(ofn 'pcmanfm') \
"nautilus" "The default file manager for Gnome" $(offon 'nautilus') \ "nautilus" "The default file manager for Gnome" $(ofn 'nautilus') \
"gparted" "A GUI frontend for creating and manipulating partition tables" $(offon 'gparted') \ "gparted" "A GUI frontend for creating and manipulating partition tables" $(ofn 'gparted') \
"file-roller" "Create and modify archives" $(offon 'file-roller') \ "file-roller" "Create and modify archives" $(ofn 'file-roller') \
"xarchiver" "A GTK+ frontend to various command line archivers" $(offon 'xarchiver'))" "xarchiver" "A GTK+ frontend to various command line archivers" $(ofn 'xarchiver'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -709,15 +706,15 @@ select_terms()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"termite" "A minimal VTE-based terminal emulator" $(offon 'termite') \ "termite" "A minimal VTE-based terminal emulator" $(ofn 'termite') \
"rxvt-unicode" "A unicode enabled rxvt-clone terminal emulator" $(offon 'rxvt-unicode') \ "rxvt-unicode" "A unicode enabled rxvt-clone terminal emulator" $(ofn 'rxvt-unicode') \
"xterm" "The standard terminal emulator for the X window system" $(offon 'xterm') \ "xterm" "The standard terminal emulator for the X window system" $(ofn 'xterm') \
"alacritty" "A cross-platform, GPU-accelerated terminal emulator" $(offon 'alacritty') \ "alacritty" "A cross-platform, GPU-accelerated terminal emulator" $(ofn 'alacritty') \
"terminator" "Terminal emulator that supports tabs and grids" $(offon 'terminator') \ "terminator" "Terminal emulator that supports tabs and grids" $(ofn 'terminator') \
"sakura" "A terminal emulator based on GTK and VTE" $(offon 'sakura') \ "sakura" "A terminal emulator based on GTK and VTE" $(ofn 'sakura') \
"tilix" "A tiling terminal emulator for Linux using GTK+ 3" $(offon 'tilix') \ "tilix" "A tiling terminal emulator for Linux using GTK+ 3" $(ofn 'tilix') \
"tilda" "A Gtk based drop down terminal for Linux and Unix" $(offon 'tilda') \ "tilda" "A Gtk based drop down terminal for Linux and Unix" $(ofn 'tilda') \
"xfce4-terminal" "A terminal emulator based in the Xfce Desktop Environment" $(offon 'xfce-terminal'))" "xfce4-terminal" "A terminal emulator based in the Xfce Desktop Environment" $(ofn 'xfce-terminal'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -725,17 +722,17 @@ select_media()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"vlc" "A free and open source cross-platform multimedia player" $(offon 'vlc') \ "vlc" "A free and open source cross-platform multimedia player" $(ofn 'vlc') \
"mpv" "A media player based on mplayer" $(offon 'mpv') \ "mpv" "A media player based on mplayer" $(ofn 'mpv') \
"mpd" "A flexible, powerful, server-side application for playing music" $(offon 'mpd') \ "mpd" "A flexible, powerful, server-side application for playing music" $(ofn 'mpd') \
"ncmpcpp" "An mpd client and almost exact clone of ncmpc with some new features" $(offon 'ncmpcpp') \ "ncmpcpp" "An mpd client and almost exact clone of ncmpc with some new features" $(ofn 'ncmpcpp') \
"cmus" "A small, fast and powerful console music player for Unix-like operating systems" $(offon 'cmus') \ "cmus" "A small, fast and powerful console music player for Unix-like operating systems" $(ofn 'cmus') \
"audacious" "A free and advanced audio player based on GTK+" $(offon 'audacious') \ "audacious" "A free and advanced audio player based on GTK+" $(ofn 'audacious') \
"nicotine+" "A graphical client for Soulseek" $(offon 'nicotine+') \ "nicotine+" "A graphical client for Soulseek" $(ofn 'nicotine+') \
"lollypop" "A new music playing application" $(offon 'lollypop') \ "lollypop" "A new music playing application" $(ofn 'lollypop') \
"rhythmbox" "Music playback and management application" $(offon 'rhythmbox') \ "rhythmbox" "Music playback and management application" $(ofn 'rhythmbox') \
"deadbeef" "A GTK+ audio player for GNU/Linux" $(offon 'deadbeef') \ "deadbeef" "A GTK+ audio player for GNU/Linux" $(ofn 'deadbeef') \
"clementine" "A modern music player and library organizer" $(offon 'clementine'))" "clementine" "A modern music player and library organizer" $(ofn 'clementine'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -743,14 +740,14 @@ select_mail()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"thunderbird" "Standalone mail and news reader from mozilla" $(offon 'thunderbird') \ "thunderbird" "Standalone mail and news reader from mozilla" $(ofn 'thunderbird') \
"geary" "A lightweight email client for the GNOME desktop" $(offon 'geary') \ "geary" "A lightweight email client for the GNOME desktop" $(ofn 'geary') \
"evolution" "Manage your email, contacts and schedule" $(offon 'evolution') \ "evolution" "Manage your email, contacts and schedule" $(ofn 'evolution') \
"mutt" "Small but very powerful text-based mail client" $(offon 'mutt') \ "mutt" "Small but very powerful text-based mail client" $(ofn 'mutt') \
"hexchat" "A popular and easy to use graphical IRC client" $(offon 'hexchat') \ "hexchat" "A popular and easy to use graphical IRC client" $(ofn 'hexchat') \
"pidgin" "Multi-protocol instant messaging client" $(offon 'pidgin') \ "pidgin" "Multi-protocol instant messaging client" $(ofn 'pidgin') \
"weechat" "Fast, light and extensible IRC client" $(offon 'weechat') \ "weechat" "Fast, light and extensible IRC client" $(ofn 'weechat') \
"irssi" "Modular text mode IRC client" $(offon 'irssi'))" "irssi" "Modular text mode IRC client" $(ofn 'irssi'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -758,18 +755,18 @@ select_prof()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"libreoffice-fresh" "Full featured office suite" $(offon 'libreoffice-fresh') \ "libreoffice-fresh" "Full featured office suite" $(ofn 'libreoffice-fresh') \
"abiword" "Fully-featured word processor" $(offon 'abiword') \ "abiword" "Fully-featured word processor" $(ofn 'abiword') \
"calligra" "A set of applications for productivity" $(offon 'calligra') \ "calligra" "A set of applications for productivity" $(ofn 'calligra') \
"gimp" "GNU Image Manipulation Program" $(offon 'gimp') \ "gimp" "GNU Image Manipulation Program" $(ofn 'gimp') \
"inkscape" "Professional vector graphics editor" $(offon 'inkscape') \ "inkscape" "Professional vector graphics editor" $(ofn 'inkscape') \
"krita" "Edit and paint images" $(offon 'krita') \ "krita" "Edit and paint images" $(ofn 'krita') \
"obs-studio" "Free opensource streaming/recording software" $(offon 'obs-studio') \ "obs-studio" "Free opensource streaming/recording software" $(ofn 'obs-studio') \
"kdenlive" "A non-linear video editor for Linux using the MLT video framework" $(offon 'kdenlive') \ "kdenlive" "A non-linear video editor for Linux using the MLT video framework" $(ofn 'kdenlive') \
"openshot" "An open-source, non-linear video editor for Linux" $(offon 'openshot') \ "openshot" "An open-source, non-linear video editor for Linux" $(ofn 'openshot') \
"audacity" "A program that lets you manipulate digital audio waveforms" $(offon 'audacity') \ "audacity" "A program that lets you manipulate digital audio waveforms" $(ofn 'audacity') \
"guvcview" "Capture video from camera devices" $(offon 'guvcview') \ "guvcview" "Capture video from camera devices" $(ofn 'guvcview') \
"simplescreenrecorder" "A feature-rich screen recorder" $(offon 'simplescreenrecorder'))" "simplescreenrecorder" "A feature-rich screen recorder" $(ofn 'simplescreenrecorder'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -777,12 +774,12 @@ select_fonts()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"ttf-hack" "A hand groomed and optically balanced typeface based on Bitstream Vera Mono" $(offon 'ttf-hack') \ "ttf-hack" "A hand groomed and optically balanced typeface based on Bitstream Vera Mono" $(ofn 'ttf-hack') \
"ttf-anonymous-pro" "A family fixed-width fonts designed with coding in mind" $(offon 'ttf-anonymous-pro') \ "ttf-anonymous-pro" "A family fixed-width fonts designed with coding in mind" $(ofn 'ttf-anonymous-pro') \
"ttf-font-awesome" "Iconic font designed for Bootstrap" $(offon 'ttf-font-awesome') \ "ttf-font-awesome" "Iconic font designed for Bootstrap" $(ofn 'ttf-font-awesome') \
"ttf-fira-code" "Monospaced font with programming ligatures" $(offon 'ttf-fira-code') \ "ttf-fira-code" "Monospaced font with programming ligatures" $(ofn 'ttf-fira-code') \
"noto-fonts" "Google Noto fonts" $(offon 'noto-fonts') \ "noto-fonts" "Google Noto fonts" $(ofn 'noto-fonts') \
"noto-fonts-cjk" "Google Noto CJK fonts (Chinese, Japanese, Korean)" $(offon 'noto-fonts-cjk'))" "noto-fonts-cjk" "Google Noto CJK fonts (Chinese, Japanese, Korean)" $(ofn 'noto-fonts-cjk'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -790,11 +787,11 @@ select_viewers()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"evince" "A document viewer" $(offon 'evince') \ "evince" "A document viewer" $(ofn 'evince') \
"zathura" "Minimalistic document viewer" $(offon 'zathura') \ "zathura" "Minimalistic document viewer" $(ofn 'zathura') \
"qpdfview" "A tabbed PDF viewer" $(offon 'qpdfview') \ "qpdfview" "A tabbed PDF viewer" $(ofn 'qpdfview') \
"mupdf" "Lightweight PDF and XPS viewer" $(offon 'mupdf') \ "mupdf" "Lightweight PDF and XPS viewer" $(ofn 'mupdf') \
"gpicview" "Lightweight image viewer" $(offon 'gpicview'))" "gpicview" "Lightweight image viewer" $(ofn 'gpicview'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -802,11 +799,11 @@ select_torrent()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"deluge" "A BitTorrent client written in python" $(offon 'deluge') \ "deluge" "A BitTorrent client written in python" $(ofn 'deluge') \
"qbittorrent" "An advanced BitTorrent client" $(offon 'qbittorrent') \ "qbittorrent" "An advanced BitTorrent client" $(ofn 'qbittorrent') \
"transmission-gtk" "Free BitTorrent client GTK+ GUI" $(offon 'transmission-gtk') \ "transmission-gtk" "Free BitTorrent client GTK+ GUI" $(ofn 'transmission-gtk') \
"transmission-qt" "Free BitTorrent client Qt GUI" $(offon 'transmission-qt') \ "transmission-qt" "Free BitTorrent client Qt GUI" $(ofn 'transmission-qt') \
"transmission-cli" "Free BitTorrent client CLI" $(offon 'transmission-cli'))" "transmission-cli" "Free BitTorrent client CLI" $(ofn 'transmission-cli'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -814,9 +811,9 @@ select_sys()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"gnome-disk-utility" "Disk Management Utility" $(offon 'gnome-disk-utility') \ "gnome-disk-utility" "Disk Management Utility" $(ofn 'gnome-disk-utility') \
"gnome-system-monitor" "View current processes and monitor system state" $(offon 'gnome-system-monitor') \ "gnome-system-monitor" "View current processes and monitor system state" $(ofn 'gnome-system-monitor') \
"qt5ct" "GUI for managing Qt based application themes, icons, and fonts" $(offon 'qt5ct'))" "qt5ct" "GUI for managing Qt based application themes, icons, and fonts" $(ofn 'qt5ct'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
@ -824,20 +821,15 @@ select_extra()
{ {
local pkgs="" local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" \ pkgs="$(checkbox "$_Packages" "$_PackageBody" \
"steam" "A popular game distribution platform by Valve" $(offon 'steam') \ "steam" "A popular game distribution platform by Valve" $(ofn 'steam') \
"gpick" "Advanced color picker using GTK+ toolkit" $(offon 'gpick') \ "gpick" "Advanced color picker using GTK+ toolkit" $(ofn 'gpick') \
"gcolor2" "A simple GTK+2 color selector" $(offon 'gcolor2') \ "gcolor2" "A simple GTK+2 color selector" $(ofn 'gcolor2') \
"plank" "An elegant, simple, and clean dock" $(offon 'plank') \ "plank" "An elegant, simple, and clean dock" $(ofn 'plank') \
"docky" "Full fledged dock for opening applications and managing windows" $(offon 'docky') \ "docky" "Full fledged dock for opening applications and managing windows" $(ofn 'docky') \
"cairo-dock" "Light eye-candy fully themable animated dock" $(offon 'cairo-dock'))" "cairo-dock" "Light eye-candy fully themable animated dock" $(ofn 'cairo-dock'))"
printf "%s" "$pkgs" printf "%s" "$pkgs"
} }
offon()
{
[[ $USER_PKGS == *$1* ]] && printf "on" || printf "off"
}
############################################################################### ###############################################################################
# partition menus # partition menus
@ -887,7 +879,7 @@ partition()
elif [[ $choice != "$_PartWipe" && $choice != "$_PartAuto" && $choice != "$_PartShowTree" ]]; then elif [[ $choice != "$_PartWipe" && $choice != "$_PartAuto" && $choice != "$_PartShowTree" ]]; then
clear; tput cnorm; $choice "$device"; partition "$device" clear; tput cnorm; $choice "$device"; partition "$device"
elif [[ $choice == "$_PartShowTree" ]]; then elif [[ $choice == "$_PartShowTree" ]]; then
msgbox "$_PrepShowDev" "\n$(lsblk -o NAME,MODEL,TYPE,FSTYPE,SIZE,MOUNTPOINT "$device")\n" msgbox "$_PartTitle" "\n$(lsblk -o NAME,MODEL,TYPE,FSTYPE,SIZE,MOUNTPOINT "$device")\n"
partition "$device" partition "$device"
elif [[ $choice == "$_PartWipe" ]]; then elif [[ $choice == "$_PartWipe" ]]; then
yesno "$_PartWipe" "$_PartBody1 $device $_PartWipeBody" && wipe -Ifrev $device yesno "$_PartWipe" "$_PartBody1 $device $_PartWipeBody" && wipe -Ifrev $device
@ -1273,7 +1265,7 @@ select_filesystem()
"reiserfs" "${FS_CMDS[reiserfs]}")" "reiserfs" "${FS_CMDS[reiserfs]}")"
fi fi
[[ $fs ]] || return 1 [[ $fs ]] || return 1
if yesno "$_FSTitle" "\nFormat $part as $fs?\n" "Format" "Go Back"; then if yesno "$_FSTitle" "\nFormat $part as $fs?\n"; then
format "$part" "$fs" || return 1 format "$part" "$fs" || return 1
else else
select_filesystem "$part" || return 1 select_filesystem "$part" || return 1
@ -1298,7 +1290,7 @@ select_efi_partition()
if grep -q 'fat' <<< "$(fsck -N "$BOOT_PART")"; then if grep -q 'fat' <<< "$(fsck -N "$BOOT_PART")"; then
local msg="$_FormUefiBody $BOOT_PART $_FormUefiBody2" local msg="$_FormUefiBody $BOOT_PART $_FormUefiBody2"
if yesno "$_PrepMount" "$msg" "Format $BOOT_PART" "Do Not Format" "no"; then if yesno "$_PrepMount" "$msg" "Format $BOOT_PART" "Skip Formatting" "no"; then
format "$BOOT_PART" "vfat" format "$BOOT_PART" "vfat"
sleep 1 sleep 1
fi fi
@ -2322,18 +2314,23 @@ luks_keyfile()
############################################################################### ###############################################################################
# helper functions # helper functions
ofn()
{
[[ $USER_PKGS == *$1* ]] && printf "on" || printf "off"
}
chrun() chrun()
{ {
arch-chroot $MNT /bin/bash -c "$1" arch-chroot $MNT /bin/bash -c "$1"
} }
json() json()
{ # extract a value from http://api.ipstack.com json output {
curl -s "http://api.ipstack.com/$2" | python3 -c "import sys, json; print(json.load(sys.stdin)['$1'])" curl -s "http://api.ipstack.com/$2" | python3 -c "import sys, json; print(json.load(sys.stdin)['$1'])"
} }
src() src()
{ # source file ($1), if it fails we die with an error message {
if ! . "$1" 2>/dev/null; then if ! . "$1" 2>/dev/null; then
printf "Failed to source file %s\n" "$1" printf "Failed to source file %s\n" "$1"
die 1 die 1
@ -2342,7 +2339,7 @@ src()
} }
is_ssd() is_ssd()
{ # returns 0 (true) when the device passed ($1) is NOT a rotational device {
local i dev=$1 local i dev=$1
# check for LVM and or LUKS for their origin devices # check for LVM and or LUKS for their origin devices
@ -2362,10 +2359,8 @@ die()
{ {
(( $# >= 1 )) && local exitcode=$1 || local exitcode=0 (( $# >= 1 )) && local exitcode=$1 || local exitcode=0
# reset SIGINT and terminal
trap - INT trap - INT
tput cnorm tput cnorm
if [[ -d $MNT ]] && command cd /; then if [[ -d $MNT ]] && command cd /; then
umount_dir $MNT umount_dir $MNT
if (( exitcode == 127 )); then if (( exitcode == 127 )); then
@ -2390,13 +2385,13 @@ die()
} }
sigint() sigint()
{ # used to trap SIGINT (^C) and cleanly exit {
printf "CTRL-C caught\nCleaning up...\n" printf "\n^C caught, cleaning up...\n"
die 1 die 1
} }
print4() print4()
{ # takes an arbitrary number of input fields and prints them out in fourths on separate lines {
local str="$*" local str="$*"
if [[ $COLUMNS -gt 110 && ${#str} -gt $((COLUMNS - 10)) ]]; then if [[ $COLUMNS -gt 110 && ${#str} -gt $((COLUMNS - 10)) ]]; then
str="$(awk '{ str="$(awk '{
@ -2434,7 +2429,6 @@ system_identify()
{ {
local efidir="/sys/firmware/efi" local efidir="/sys/firmware/efi"
# for virtual machine remove the ucode
if [[ $VM ]]; then if [[ $VM ]]; then
UCODE="" UCODE=""
elif grep -q 'AuthenticAMD' /proc/cpuinfo; then elif grep -q 'AuthenticAMD' /proc/cpuinfo; then
@ -2497,7 +2491,6 @@ net_connect()
return 1 return 1
fi fi
fi fi
# if we've made it here we likely have a good connection
return 0 return 0
} }
@ -2510,11 +2503,7 @@ system_checks()
infobox "$_ErrTitle" "$_Not64Bit\n$_Exit" infobox "$_ErrTitle" "$_Not64Bit\n$_Exit"
die 1 die 1
fi fi
# setup for specific broadcom chips
grep -q 'BCM4352' <<< "$(lspci -vnn -d 14e4:)" && load_bcm grep -q 'BCM4352' <<< "$(lspci -vnn -d 14e4:)" && load_bcm
# connect or confirm connection, otherwise bail
net_connect || { infobox "$_ErrTitle" "$_NoNetwork\n$_Exit" 3; die 1; } net_connect || { infobox "$_ErrTitle" "$_NoNetwork\n$_Exit" 3; die 1; }
} }
@ -2631,20 +2620,18 @@ yesno()
############################################################################### ###############################################################################
# entry point # entry point
# trap Ctrl-C to properly exit
trap sigint INT trap sigint INT
for arg in "$@"; do for arg in "$@"; do
[[ $arg =~ (--debug|-d) ]] && debug [[ $arg =~ (--debug|-d) ]] && debug
done done
# initial prep
src /usr/share/archlabs/installer/lang/english.trans src /usr/share/archlabs/installer/lang/english.trans
select_keymap || die 0
system_checks system_checks
system_identify system_identify
system_devices system_devices
msgbox "$_WelTitle $DIST Installer" "$_WelBody" msgbox "$_WelTitle $DIST Installer" "$_WelBody"
select_keymap || die 0
while true; do while true; do
main main