Skip to content

Commit b893de0

Browse files
committed
Check and install dialog if missing
1 parent 2988db2 commit b893de0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

install.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ check_sudo_privileges() {
7070
install_essential_apps() {
7171
clear
7272

73+
# Check if dialog is installed, and if not, install it
74+
if ! [ -x "$(command -v dialog)" ]; then
75+
echo "Dialog is not installed. Installing dialog..."
76+
sudo apt update && sudo apt install dialog -y
77+
fi
78+
7379
while true; do
7480
# Define the dialog menu options
7581
options=("1" "htop - Interactive process viewer" off
@@ -82,7 +88,7 @@ install_essential_apps() {
8288
"8" "git - Version control system" off)
8389

8490
# Display the dialog menu and store the user's choices
85-
choices=$(dialog --clear --title "Select Essential Apps" --checklist "Choose which essential apps to install:" 0 0 0 "${options[@]}" 2>&1 >/dev/tty)
91+
choices=$(dialog --clear --title "Essential Apps Installer" --checklist "Choose which apps to install:" 0 0 0 "${options[@]}" 2>&1 >/dev/tty)
8692

8793
# Check if the user canceled or made no selection
8894
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)