diff --git a/setup.py b/setup.py index fc155e8..79148e9 100644 --- a/setup.py +++ b/setup.py @@ -35,6 +35,7 @@ def choices(): def menu(): global menu2 + menu2.clear() choices_list = choices().splitlines() choices_list.append("Exit") menu1 = inquirer.select( @@ -88,16 +89,16 @@ def menu(): elif menu1 == "Drivers": vendors = ["NVIDIA", "AMD", "Intel", "Back to Main Menu"] - menu2 = inquirer.select( + selected_vendor = inquirer.select( message = "Select your GPU vendor", choices = vendors, default = None, multiselect = False ).execute() - if menu2 == "Back to Main Menu": + if selected_vendor == "Back to Main Menu": menu() else: - install_drivers(menu2) + install_drivers(selected_vendor) elif menu1 == "Enable RPM Fusion": enable_rpmfusion() @@ -260,7 +261,7 @@ def install_drivers(vendor): elif which("dnf") is not None or which("yum") is not None: os.system("sudo dnf install -y intel-media-driver") elif which("pacman") is not None: - driver = ["intel-media-driver", "libva-intel-driver"] + driver = ["intel-media-driver", "libva-intel-driver", "Back to Main Menu"] gpu = inquirer.select( message = "Choose driver", choices = driver, @@ -271,6 +272,8 @@ def install_drivers(vendor): os.system("sudo pacman -S --noconfirm intel-media-driver") elif gpu == "libva-intel-driver": os.system("sudo pacman -S --noconfirm libva-intel-driver") + elif gpu == "Back to Main Menu": + menu() elif vendor == "NVIDIA": if which("apt") is not None: os.system("sudo apt install -y nvidia-driver") @@ -278,7 +281,7 @@ def install_drivers(vendor): os.system("sudo dnf install -y akmod-nvidia") elif which("pacman") is not None: os.system("sudo pacman -S --noconfirm nvidia") - + menu() def install_other():