whiptail broken, switching to dialog

This commit is contained in:
MatMoul 2022-11-10 20:33:17 +01:00
parent b0f0cba517
commit 850025e475

122
archfi
View file

@ -34,7 +34,7 @@ mainmenu(){
options+=("${txtselectpartsmenu}" "") options+=("${txtselectpartsmenu}" "")
options+=("" "") options+=("" "")
options+=("${txtreboot}" "") options+=("${txtreboot}" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtmainmenu}" --menu "" --cancel-button "${txtexit}" --default-item "${nextitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtmainmenu}" --cancel-button "${txtexit}" --default-item "${nextitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -95,7 +95,7 @@ chooselanguage(){
options+=("Russian" "(By Anonymous_Prodject)") options+=("Russian" "(By Anonymous_Prodject)")
options+=("Spanish" "(By Mystogab)") options+=("Spanish" "(By Mystogab)")
options+=("Turkish" "(By c0b41)") options+=("Turkish" "(By c0b41)")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtlanguage}" --menu "" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtlanguage}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -128,7 +128,7 @@ setkeymap(){
for item in ${items}; do for item in ${items}; do
options+=("${item%%.*}" "") options+=("${item%%.*}" "")
done done
keymap=$(whiptail --backtitle "${apptitle}" --title "${txtsetkeymap}" --menu "" 0 0 0 \ keymap=$(dialog --backtitle "${apptitle}" --title "${txtsetkeymap}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -145,7 +145,7 @@ chooseeditor(){
options+=("vim" "") options+=("vim" "")
options+=("vi" "") options+=("vi" "")
options+=("edit" "") options+=("edit" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txteditor}" --menu "" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txteditor}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -158,7 +158,7 @@ chooseeditor(){
} }
rebootpc(){ rebootpc(){
if (whiptail --backtitle "${apptitle}" --title "${txtreboot}" --yesno "${txtreboot} ?" --defaultno 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtreboot}" --defaultno --yesno "${txtreboot} ?" 0 0) then
clear clear
reboot reboot
fi fi
@ -178,7 +178,7 @@ selectdisk(){
options+=("${item}" "") options+=("${item}" "")
done done
IFS=$IFS_ORIG IFS=$IFS_ORIG
result=$(whiptail --backtitle "${APPTITLE}" --title "${1}" --menu "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3) result=$(dialog --backtitle "${APPTITLE}" --title "${1}" --menu "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3)
if [ "$?" != "0" ] if [ "$?" != "0" ]
then then
return 1 return 1
@ -205,7 +205,7 @@ diskpartmenu(){
fi fi
options+=("${txteditparts} (cfdisk)" "") options+=("${txteditparts} (cfdisk)" "")
options+=("${txteditparts} (cgdisk)" "") options+=("${txteditparts} (cgdisk)" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtdiskpartmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtdiskpartmenu}" --cancel-button "${txtback}" --default-item "${nextitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -243,7 +243,7 @@ diskpartmenu(){
diskpartautodos(){ diskpartautodos(){
device=$(selectdisk "${txtautoparts} (dos)") device=$(selectdisk "${txtautoparts} (dos)")
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (dos)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtautoparts} (dos)" --defaultno --yesno "${txtautopartsconfirm//%1/${device}}" 0 0) then
clear clear
echo "${txtautopartclear}" echo "${txtautopartclear}"
parted ${device} mklabel msdos parted ${device} mklabel msdos
@ -278,7 +278,7 @@ diskpartautodos(){
diskpartautogpt(){ diskpartautogpt(){
device=$(selectdisk "${txtautoparts} (gpt)") device=$(selectdisk "${txtautoparts} (gpt)")
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtautoparts} (gpt)" --defaultno --yesno "${txtautopartsconfirm//%1/${device}}" 0 0) then
clear clear
echo "${txtautopartclear}" echo "${txtautopartclear}"
parted ${device} mklabel gpt parted ${device} mklabel gpt
@ -311,7 +311,7 @@ diskpartautogpt(){
diskpartautoefi(){ diskpartautoefi(){
device=$(selectdisk "${txtautoparts} (gpt,efi)") device=$(selectdisk "${txtautoparts} (gpt,efi)")
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --defaultno --yesno "${txtautopartsconfirm//%1/${device}}" 0 0) then
clear clear
echo "${txtautopartclear}" echo "${txtautopartclear}"
parted ${device} mklabel gpt parted ${device} mklabel gpt
@ -342,7 +342,7 @@ diskpartautoefi(){
diskpartautoefiusb(){ diskpartautoefiusb(){
device=$(selectdisk "${txtautoparts} (gpt,efi)") device=$(selectdisk "${txtautoparts} (gpt,efi)")
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --defaultno --yesno "${txtautopartsconfirm//%1/${device}}" 0 0) then
clear clear
echo "${txtautopartclear}" echo "${txtautopartclear}"
parted ${device} mklabel gpt parted ${device} mklabel gpt
@ -397,7 +397,7 @@ selectparts(){
options+=("${item}" "") options+=("${item}" "")
done done
bootdev=$(whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --menu "${txtselectdevice//%1/boot}" --default-item "${bootdev}" 0 0 0 \ bootdev=$(dialog --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --default-item "${bootdev}" --menu "${txtselectdevice//%1/boot}" 0 0 0 \
"none" "-" \ "none" "-" \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
@ -409,7 +409,7 @@ selectparts(){
fi fi
fi fi
swapdev=$(whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --menu "${txtselectdevice//%1/swap}" --default-item "${swapdev}" 0 0 0 \ swapdev=$(dialog --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --default-item "${swapdev}" --menu "${txtselectdevice//%1/swap}" 0 0 0 \
"none" "-" \ "none" "-" \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
@ -421,7 +421,7 @@ selectparts(){
fi fi
fi fi
rootdev=$(whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --menu "${txtselectdevice//%1/root}" --default-item "${rootdev}" 0 0 0 \ rootdev=$(dialog --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --default-item "${rootdev}" --menu "${txtselectdevice//%1/root}" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -429,7 +429,7 @@ selectparts(){
fi fi
realrootdev=${rootdev} realrootdev=${rootdev}
homedev=$(whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --menu "${txtselectdevice//%1/home}" 0 0 0 \ homedev=$(dialog --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --menu "${txtselectdevice//%1/home}" 0 0 0 \
"none" "-" \ "none" "-" \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
@ -446,7 +446,7 @@ selectparts(){
msg=${msg}"swap : "${swapdev}"\n" msg=${msg}"swap : "${swapdev}"\n"
msg=${msg}"root : "${rootdev}"\n" msg=${msg}"root : "${rootdev}"\n"
msg=${msg}"home : "${homedev}"\n\n" msg=${msg}"home : "${homedev}"\n\n"
if (whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --yesno "${msg}" 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --yesno "${msg}" 0 0) then
isnvme=0 isnvme=0
if [ "${bootdev::8}" == "/dev/nvm" ]; then if [ "${bootdev::8}" == "/dev/nvm" ]; then
isnvme=1 isnvme=1
@ -471,7 +471,7 @@ mountmenu(){
options=() options=()
options+=("${txtformatdevices}" "") options+=("${txtformatdevices}" "")
options+=("${txtmount}" "${txtmountdesc}") options+=("${txtmount}" "${txtmountdesc}")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatmountmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtformatmountmenu}" --cancel-button "${txtback}" --default-item "${nextitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -491,7 +491,7 @@ mountmenu(){
formatdevices(){ formatdevices(){
if (whiptail --backtitle "${apptitle}" --title "${txtformatdevices}" --yesno "${txtformatdeviceconfirm}" --defaultno 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtformatdevices}" --defaultno --yesno "${txtformatdeviceconfirm}" 0 0) then
fspkgs="" fspkgs=""
if [ ! "${bootdev}" = "" ]; then if [ ! "${bootdev}" = "" ]; then
formatbootdevice boot ${bootdev} formatbootdevice boot ${bootdev}
@ -516,7 +516,7 @@ formatbootdevice(){
if [ ! "${efimode}" = "1" ]&&[ ! "${efimode}" = "2" ]; then if [ ! "${efimode}" = "1" ]&&[ ! "${efimode}" = "2" ]; then
options+=("fat32" "(EFI)") options+=("fat32" "(EFI)")
fi fi
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "${txtselectpartformat//%1/${1} (${2})}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "${txtselectpartformat//%1/${1} (${2})}" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -550,7 +550,7 @@ formatbootdevice(){
formatswapdevice(){ formatswapdevice(){
options=() options=()
options+=("swap" "") options+=("swap" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "${txtselectpartformat//%1/${1} (${2})}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "${txtselectpartformat//%1/${1} (${2})}" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -582,7 +582,7 @@ formatdevice(){
if [ ! "${3}" = "noluks" ]; then if [ ! "${3}" = "noluks" ]; then
options+=("luks" "encrypted") options+=("luks" "encrypted")
fi fi
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "${txtselectpartformat//%1/${1} (${2})}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "${txtselectpartformat//%1/${1} (${2})}" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -660,7 +660,7 @@ formatdevice(){
options=() options=()
options+=("normal" "") options+=("normal" "")
options+=("fast" "") options+=("fast" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "Wipe device ?" --cancel-button="${txtignore}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "Wipe device ?" --cancel-button="${txtignore}" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -743,7 +743,7 @@ installmenu(){
options+=("${txtparalleldownloads}" "(${txtoptional})") options+=("${txtparalleldownloads}" "(${txtoptional})")
options+=("${txtinstallarchlinux}" "pacstrap") options+=("${txtinstallarchlinux}" "pacstrap")
options+=("${txtconfigarchlinux}" "") options+=("${txtconfigarchlinux}" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallmenu}" --menu "" --cancel-button "${txtunmount}" --default-item "${nextitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtinstallmenu}" --cancel-button "${txtunmount}" --default-item "${nextitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -792,7 +792,7 @@ selectmirrorsbycountry() {
options+=("${item}" "") options+=("${item}" "")
done done
IFS=$IFS_ORIG IFS=$IFS_ORIG
country=$(whiptail --backtitle "${APPTITLE}" --title "${txtselectcountry}" --menu "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3) country=$(dialog --backtitle "${APPTITLE}" --title "${txtselectcountry}" --menu "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3)
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
return 1 return 1
fi fi
@ -807,7 +807,7 @@ filtermirrorlist() {
options=() options=()
options+=("${txtfiltermirrorlist}" "") options+=("${txtfiltermirrorlist}" "")
options+=("${txtedit//%1/reflector.conf}" "") options+=("${txtedit//%1/reflector.conf}" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallmenu}" --menu "" --cancel-button "${txtback}" --default-item "Filter mirrorlist" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtinstallmenu}" --cancel-button "${txtback}" --default-item "Filter mirrorlist" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
case ${sel} in case ${sel} in
@ -825,7 +825,7 @@ filtermirrorlist() {
} }
paralleldownloads() { paralleldownloads() {
numpkg=$(whiptail --backtitle "${apptitle}" --title "${txtparallelprompt}" --inputbox "" 0 0 "5" 3>&1 1>&2 2>&3) numpkg=$(dialog --backtitle "${apptitle}" --title "${txtparallelprompt}" --inputbox "" 0 0 "5" 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
if [[ "$numpkg" =~ ^[1-9][0-9]*$ ]] ; then if [[ "$numpkg" =~ ^[1-9][0-9]*$ ]] ; then
sed -i "s/.*ParallelDownloads.*/ParallelDownloads = ${numpkg}/" /etc/pacman.conf sed -i "s/.*ParallelDownloads.*/ParallelDownloads = ${numpkg}/" /etc/pacman.conf
@ -847,7 +847,7 @@ installbase(){
options+=("linux-lts" "") options+=("linux-lts" "")
options+=("linux-zen" "") options+=("linux-zen" "")
options+=("linux-hardened" "") options+=("linux-hardened" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallarchlinuxkernel}" --menu "" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtinstallarchlinuxkernel}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -858,7 +858,7 @@ installbase(){
options=() options=()
options+=("linux-firmware" "(${txtoptional})" on) options+=("linux-firmware" "(${txtoptional})" on)
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallarchlinuxfirmwares}" --checklist "" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtinstallarchlinuxfirmwares}" --checklist "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -901,7 +901,7 @@ installbase(){
fi fi
options+=("lvm2" "" off) options+=("lvm2" "" off)
options+=("dmraid" "" off) options+=("dmraid" "" off)
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallarchlinuxfilesystems}" --checklist "" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtinstallarchlinuxfilesystems}" --checklist "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -918,7 +918,7 @@ installbase(){
while read pkg; do while read pkg; do
options+=("${pkg}" "" on) options+=("${pkg}" "" on)
done < /tmp/archfi-custom-package-list done < /tmp/archfi-custom-package-list
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallarchlinuxcustompackagelist}" --checklist "" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtinstallarchlinuxcustompackagelist}" --checklist "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -983,7 +983,7 @@ archmenu(){
options+=("${txtbootloader}" "") options+=("${txtbootloader}" "")
options+=("${txtextrasmenu}" "") options+=("${txtextrasmenu}" "")
options+=("archdi" "${txtarchdidesc}") options+=("archdi" "${txtarchdidesc}")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtarchinstallmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtarchinstallmenu}" --cancel-button "${txtback}" --default-item "${nextitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1089,6 +1089,9 @@ archchroot(){
echo "arch-chroot /mnt /root" echo "arch-chroot /mnt /root"
cp ${0} /mnt/root cp ${0} /mnt/root
chmod 755 /mnt/root/$(basename "${0}") chmod 755 /mnt/root/$(basename "${0}")
echo "dialog is required for archfi, it will be installed as dep. Then it will removed when cleaning orphan."
echo "arch-chroot /mnt pacman -S --asdeps --needed --noconfirm dialog"
arch-chroot /mnt pacman -S --asdeps --needed --noconfirm dialog
arch-chroot /mnt /root/$(basename "${0}") --chroot ${1} ${2} arch-chroot /mnt /root/$(basename "${0}") --chroot ${1} ${2}
rm /mnt/root/$(basename "${0}") rm /mnt/root/$(basename "${0}")
echo "exit" echo "exit"
@ -1096,7 +1099,7 @@ archchroot(){
archsethostname(){ archsethostname(){
hostname=$(whiptail --backtitle "${apptitle}" --title "${txtsethostname}" --inputbox "" 0 0 "archlinux" 3>&1 1>&2 2>&3) hostname=$(dialog --backtitle "${apptitle}" --title "${txtsethostname}" --inputbox "" 0 0 "archlinux" 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
clear clear
echo "echo \"${hostname}\" > /mnt/etc/hostname" echo "echo \"${hostname}\" > /mnt/etc/hostname"
@ -1120,7 +1123,7 @@ archsetkeymap(){
fi fi
options+=("${item%%.*}" "") options+=("${item%%.*}" "")
done done
keymap=$(whiptail --backtitle "${apptitle}" --title "${txtsetkeymap}" --menu "" --default-item "${defsel}" 0 0 0 \ keymap=$(dialog --backtitle "${apptitle}" --title "${txtsetkeymap}" --default-item "${defsel}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1138,7 +1141,7 @@ archsetfont(){
for item in ${items}; do for item in ${items}; do
options+=("${item%%.*}" "") options+=("${item%%.*}" "")
done done
vcfont=$(whiptail --backtitle "${apptitle}" --title "${txtsetfont} (${txtoptional})" --menu "" 0 0 0 \ vcfont=$(dialog --backtitle "${apptitle}" --title "${txtsetfont} (${txtoptional})" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1159,7 +1162,7 @@ archsetlocale(){
fi fi
options+=("${item}" "") options+=("${item}" "")
done done
locale=$(whiptail --backtitle "${apptitle}" --title "${txtsetlocale}" --menu "" --default-item "${defsel}" 0 0 0 \ locale=$(dialog --backtitle "${apptitle}" --title "${txtsetlocale}" --default-item "${defsel}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1187,7 +1190,7 @@ archsettime(){
options+=("${item}" "") options+=("${item}" "")
done done
timezone=$(whiptail --backtitle "${apptitle}" --title "${txtsettime}" --menu "" 0 0 0 \ timezone=$(dialog --backtitle "${apptitle}" --title "${txtsettime}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -1201,7 +1204,7 @@ archsettime(){
options+=("${item}" "") options+=("${item}" "")
done done
timezone=${timezone}/$(whiptail --backtitle "${apptitle}" --title "${txtsettime}" --menu "" 0 0 0 \ timezone=${timezone}/$(dialog --backtitle "${apptitle}" --title "${txtsettime}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -1216,7 +1219,7 @@ archsettime(){
options=() options=()
options+=("UTC" "") options+=("UTC" "")
options+=("Local" "") options+=("Local" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtsettime}" --menu "${txthwclock}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtsettime}" --menu "${txthwclock}" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -1233,7 +1236,7 @@ archsettime(){
;; ;;
esac esac
# if (whiptail --backtitle "${apptitle}" --title "${txtsettime}" --yesno "${txtuseutcclock}" 0 0) then # if (dialog --backtitle "${apptitle}" --title "${txtsettime}" --yesno "${txtuseutcclock}" 0 0) then
# clear # clear
# archchroot settimeutc # archchroot settimeutc
# else # else
@ -1276,7 +1279,7 @@ archgenfstabmenu(){
options+=("LABEL" "genfstab -L") options+=("LABEL" "genfstab -L")
options+=("PARTUUID" "genfstab -t PARTUUID") options+=("PARTUUID" "genfstab -t PARTUUID")
options+=("PARTLABEL" "genfstab -t PARTLABEL") options+=("PARTLABEL" "genfstab -t PARTLABEL")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtgenerate//%1/fstab}" --menu "" --cancel-button "${txtback}" --default-item "${nextitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtgenerate//%1/fstab}" --cancel-button "${txtback}" --default-item "${nextitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1330,7 +1333,7 @@ archgenmkinitcpionvme(){
archeditmkinitcpio(){ archeditmkinitcpio(){
${EDITOR} /mnt/etc/mkinitcpio.conf ${EDITOR} /mnt/etc/mkinitcpio.conf
if (whiptail --backtitle "${apptitle}" --title "${txtedit//%1/mkinitcpio.conf}" --yesno "${txtgenerate//%1/mkinitcpio} ?" 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtedit//%1/mkinitcpio.conf}" --yesno "${txtgenerate//%1/mkinitcpio} ?" 0 0) then
clear clear
archchroot genmkinitcpio archchroot genmkinitcpio
pressanykey pressanykey
@ -1353,7 +1356,7 @@ archbootloadermenu(){
if [ "${efimode}" != "2" ]; then if [ "${efimode}" != "2" ]; then
options+=("syslinux" "") options+=("syslinux" "")
fi fi
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloadermenu}" --menu "" --cancel-button "${txtback}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtbootloadermenu}" --cancel-button "${txtback}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1377,7 +1380,7 @@ archbootloadergrubmenu(){
options+=("${txtinstall//%1/grub}" "pacstrap grub (efibootmgr), grub-mkconfig") options+=("${txtinstall//%1/grub}" "pacstrap grub (efibootmgr), grub-mkconfig")
options+=("${txtedit//%1/grub}" "(${txtoptional})") options+=("${txtedit//%1/grub}" "(${txtoptional})")
options+=("${txtinstall//%1/bootloader}" "grub-install") options+=("${txtinstall//%1/bootloader}" "grub-install")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloadergrubmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextblitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtbootloadergrubmenu}" --cancel-button "${txtback}" --default-item "${nextblitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1388,7 +1391,7 @@ archbootloadergrubmenu(){
;; ;;
"${txtedit//%1/grub}") "${txtedit//%1/grub}")
${EDITOR} /mnt/etc/default/grub ${EDITOR} /mnt/etc/default/grub
if (whiptail --backtitle "${apptitle}" --title "${txtedit//%1/grub}" --yesno "${txtrungrubmakeconfig}" 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtedit//%1/grub}" --yesno "${txtrungrubmakeconfig}" 0 0) then
clear clear
archchroot grubinstall archchroot grubinstall
pressanykey pressanykey
@ -1412,14 +1415,14 @@ archgrubinstall(){
if [ "${eficomputer}" == "1" ]; then if [ "${eficomputer}" == "1" ]; then
if [ "${efimode}" == "1" ]||[ "${efimode}" == "2" ]; then if [ "${efimode}" == "1" ]||[ "${efimode}" == "2" ]; then
if (whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/efibootmgr}" --yesno "${txtefibootmgr}" 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtinstall//%1/efibootmgr}" --yesno "${txtefibootmgr}" 0 0) then
clear clear
echo "pacstrap /mnt efibootmgr" echo "pacstrap /mnt efibootmgr"
pacstrap /mnt efibootmgr pacstrap /mnt efibootmgr
pressanykey pressanykey
fi fi
else else
if (whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/efibootmgr}" --yesno "${txtefibootmgr}" --defaultno 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtinstall//%1/efibootmgr}" --defaultno --yesno "${txtefibootmgr}" 0 0) then
clear clear
echo "pacstrap /mnt efibootmgr" echo "pacstrap /mnt efibootmgr"
pacstrap /mnt efibootmgr pacstrap /mnt efibootmgr
@ -1429,7 +1432,7 @@ archgrubinstall(){
fi fi
if [ "${luksroot}" = "1" ]; then if [ "${luksroot}" = "1" ]; then
if (whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/grub}" --yesno "${txtgrubluksdetected}" 0 0) then if (dialog --backtitle "${apptitle}" --title "${txtinstall//%1/grub}" --yesno "${txtgrubluksdetected}" 0 0) then
clear clear
echo "sed -i /GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX=\\\"cryptdevice=/dev/disk/by-uuid/${luksrootuuid}:root\\\" /mnt/etc/default/grub" echo "sed -i /GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX=\\\"cryptdevice=/dev/disk/by-uuid/${luksrootuuid}:root\\\" /mnt/etc/default/grub"
sed -i /GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX=\"cryptdevice=/dev/disk/by-uuid/${luksrootuuid}:root\" /mnt/etc/default/grub sed -i /GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX=\"cryptdevice=/dev/disk/by-uuid/${luksrootuuid}:root\" /mnt/etc/default/grub
@ -1467,7 +1470,7 @@ archgrubinstallbootloader(){
options+=("EFI" "") options+=("EFI" "")
options+=("BIOS+EFI" "") options+=("BIOS+EFI" "")
fi fi
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/bootloader}" --menu "" --cancel-button "${txtback}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtinstall//%1/bootloader}" --cancel-button "${txtback}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1531,7 +1534,7 @@ archbootloadersyslinuxbmenu(){
options+=("${txtinstall//%1/syslinux}" "pacstrap syslinux (gptfdisk,mtools)") options+=("${txtinstall//%1/syslinux}" "pacstrap syslinux (gptfdisk,mtools)")
options+=("${txtedit//%1/syslinux}" "(${txtoptional})") options+=("${txtedit//%1/syslinux}" "(${txtoptional})")
options+=("${txtinstall//%1/bootloader}" "syslinux-install_update") options+=("${txtinstall//%1/bootloader}" "syslinux-install_update")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloadersyslinuxmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextblitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtbootloadersyslinuxmenu}" --cancel-button "${txtback}" --default-item "${nextblitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1642,7 +1645,7 @@ archbootloadersystemdbmenu(){
options+=("${txtinstall//%1/systemd-boot}" "bootctl install") options+=("${txtinstall//%1/systemd-boot}" "bootctl install")
options+=("${txtedit//%1/loader.conf}" "(${txtoptional})") options+=("${txtedit//%1/loader.conf}" "(${txtoptional})")
options+=("${txtedit//%1/entries}" "(${txtoptional})") options+=("${txtedit//%1/entries}" "(${txtoptional})")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloadersystemdmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextblitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtbootloadersystemdmenu}" --cancel-button "${txtback}" --default-item "${nextblitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1726,7 +1729,7 @@ archbootloaderrefindmenu(){
options=() options=()
options+=("${txtinstall//%1/refind}" "pacstrap refind-efi") options+=("${txtinstall//%1/refind}" "pacstrap refind-efi")
options+=("${txtedit//%1/refind_linux.conf}" "(${txtoptional})") options+=("${txtedit//%1/refind_linux.conf}" "(${txtoptional})")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloaderrefindmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextblitem}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtbootloaderrefindmenu}" --cancel-button "${txtback}" --default-item "${nextblitem}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1780,7 +1783,7 @@ archextrasmenu(){
options+=("vim" "" on) options+=("vim" "" on)
options+=("dhcpcd" "" on) options+=("dhcpcd" "" on)
options+=("networkmanager" "" off) options+=("networkmanager" "" off)
sel=$(whiptail --backtitle "${apptitle}" --title "${txtextrasmenu}" --checklist "" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtextrasmenu}" --checklist "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -1813,18 +1816,13 @@ archenablenetworkmanagerchroot(){
} }
installarchdi(){ installarchdi(){
txtinstallarchdi="Arch Linux Desktop Install (archdi) is a second script who can help you to install a full workstation.\n\nYou can just launch the script or install it. Choose in the next menu.\n\nArch Linux Desktop Install as two dependencies : wget and libnewt.\n\npacstrap wget libnewt ?" dialog --backtitle "${apptitle}" --title "archdi" --msgbox "${txtinstallarchdi}" 0 0
if(whiptail --backtitle "${apptitle}" --title "archdi" --yesno "${txtinstallarchdi}" 0 0) then
clear
echo "pacstrap /mnt wget libnewt"
pacstrap /mnt wget libnewt
fi
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
options=() options=()
options+=("${txtarchdiinstallandlaunch}" "") options+=("${txtarchdiinstallandlaunch}" "")
options+=("${txtarchdilaunch}" "") options+=("${txtarchdilaunch}" "")
options+=("${txtarchdiinstall}" "") options+=("${txtarchdiinstall}" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtarchdimenu}" --menu "" --cancel-button "${txtback}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtarchdimenu}" --cancel-button "${txtback}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -1846,7 +1844,7 @@ archdidownload(){
options=() options=()
options+=("sourceforge.net" " (Recommended)") options+=("sourceforge.net" " (Recommended)")
options+=("github.com" "") options+=("github.com" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtselectserver}" --menu "" --cancel-button "${txtback}" 0 0 0 \ sel=$(dialog --backtitle "${apptitle}" --title "${txtselectserver}" --cancel-button "${txtback}" --menu "" 0 0 0 \
"${options[@]}" \ "${options[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@ -2000,7 +1998,7 @@ loadstrings(){
txtpressanykey="Press any key to continue." txtpressanykey="Press any key to continue."
txtarchdidesc="Full desktop install script" txtarchdidesc="Full desktop install script"
txtinstallarchdi="Arch Linux Desktop Install (archdi) is a second script who can help you to install a full workstation.\n\nYou can just launch the script or install it. Choose in the next menu.\n\nArch Linux Desktop Install as two dependencies : wget and libnewt.\n\npacstrap wget and libnewt?" txtinstallarchdi="Arch Linux Desktop Install (archdi) is a second script who can help you to install a full workstation.\n\nYou can just launch the script or install it. Choose in the next menu."
txtarchdiinstallandlaunch="Install and run archdi" txtarchdiinstallandlaunch="Install and run archdi"
txtarchdiinstall="Install archdi" txtarchdiinstall="Install archdi"
txtarchdilaunch="Launch archdi" txtarchdilaunch="Launch archdi"
@ -2075,7 +2073,7 @@ if [ "${chroot}" = "1" ]; then
'archdilaunch') archdilaunchchroot;; 'archdilaunch') archdilaunchchroot;;
esac esac
else else
pacman -S --needed arch-install-scripts wget libnewt pacman -Sy --needed arch-install-scripts dialog
dmesg |grep efi: > /dev/null dmesg |grep efi: > /dev/null
if [ "$?" == "1" ]; then if [ "$?" == "1" ]; then
if [ "${eficomputer}" != "1" ]; then if [ "${eficomputer}" != "1" ]; then