diff --git a/NoiceGRUB.py b/NoiceGRUB.py index 1a8a358..21d1729 100644 --- a/NoiceGRUB.py +++ b/NoiceGRUB.py @@ -30,9 +30,7 @@ elif preset[0]=='Mountains': NgMountainsTemplate(preset).export_theme() elif preset[0]=='Nico': NgNicoTemplate(preset).export_theme() -if Confirm.ask('[yellow bold]Do you want to place the generated theme in /boot/grub/themes/[/yellow bold]'): - richprint('\n[green bold]Executing scripts/install.sh ... [/green bold]') - os.system('chmod +x ./scripts/install.sh') - os.system('sudo ./scripts/install.sh') - richprint('[green bold]Done') +richprint('\n[green bold]Executing scripts/install.sh ... [/green bold]') +os.system('chmod +x ./scripts/install.sh') +os.system('sudo ./scripts/install.sh') richprint('[green bold]Thankyou for using NoiceGRUB[/green bold]') \ No newline at end of file diff --git a/noicegrub/__init__.py b/noicegrub/__init__.py index d0c1d61..664c6d8 100644 --- a/noicegrub/__init__.py +++ b/noicegrub/__init__.py @@ -28,4 +28,4 @@ def preset_table(): 8 `b8 8 8 8 8 . 8. 8 8 8 8 8 8 8 8 8 `8 `YooP' 8 `YooP' `Yooo' `YooP8 8 8 `YooP' 8oooP' ..:::..:.....::..:.....::.....::....8 :..:::..:.....::......: -:::::::: @1337kid ::::::::::::::::::8 ::::::: v1.8.2 :::::::::\n''' \ No newline at end of file +:::::::: @1337kid ::::::::::::::::::8 ::::::: v1.8.3 ::::::::\n''' \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh index 18162eb..318558f 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,19 +1,41 @@ #!/bin/bash +GRUB_PATH='' THEMES_PATH='' -#========================== get_path() { if [[ -d "/boot/grub2" ]]; then - THEMES_PATH='/boot/grub2/themes/noicegrub' + GRUB_PATH='/boot/grub2/' elif [[ -d "/boot/grub" ]]; then - THEMES_PATH='/boot/grub/themes/noicegrub' + GRUB_PATH='/boot/grub/' elif [[ -d "/boot/efi/EFI/fedora" ]]; then - THEMES_PATH='/boot/efi/EFI/fedora/themes/noicegrub' + GRUB_PATH='/boot/efi/EFI/fedora/' fi } -get_path + +install() { + printf "\033[92m[+] \033[94mCreating $THEME_PATH\n" + mkdir -p $THEME_PATH + printf "\033[92m[+] \033[94mCopying files\n" + cp ./export/* $THEME_PATH + sed -i 's/.*GRUB_THEME=.*//' /etc/default/grub + echo "GRUB_THEME=$THEME_PATH/theme.txt" >> /etc/default/grub + # + #========= GRUB update + # + printf "\033[92m[+] \033[94mUpdating GRUB config\n\033[92m" + if [[ $(which dnf) != "" ]];then + fedora_version=$(cat /etc/fedora-release | awk '{print $3}') + if [[ fedora_version -gt 34 ]];then + grub2-mkconfig -o /boot/grub2/grub.cfg + else + grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg + fi + else + update-grub + fi +} #========================= printf "\033[94m\033[1m" @@ -23,7 +45,7 @@ cat <> /etc/default/grub -printf "\033[92m[+] \033[94mRunning update-grub\n\033[92m" -update-grub \ No newline at end of file +get_path +THEME_PATH=$GRUB_PATH"themes/noicegrub" +printf "\033[1m\033[93m" +read -p "Do you want to place the generated theme in $GRUB_PATH [y/n] " inst +case $inst in + [Yy]* ) install;; + * ) exit;; +esac \ No newline at end of file