diff --git a/just/bluefin-system.just b/just/bluefin-system.just index 981f13d6909..8ca13896976 100644 --- a/just/bluefin-system.just +++ b/just/bluefin-system.just @@ -174,3 +174,7 @@ install-system-flatpaks: fi FLATPAK_LIST="$(curl https://raw.githubusercontent.com/ublue-os/bluefin/main/${FLATPAKS} | tr '\n' ' ')" flatpak --system -y install ${FLATPAK_LIST} + +# Configure grub bootmenu visibility +configure-grub: + /usr/libexec/configure-grub.sh diff --git a/system_files/shared/usr/libexec/configure-grub.sh b/system_files/shared/usr/libexec/configure-grub.sh new file mode 100755 index 00000000000..2039bd5acf9 --- /dev/null +++ b/system_files/shared/usr/libexec/configure-grub.sh @@ -0,0 +1,26 @@ +#!/bin/bash +source /usr/lib/ujust/ujust.sh +GRUB_STATE="$(sudo grub2-editenv list | grep "^menu_auto_hide=")" +if [[ "$GRUB_STATE" == "menu_auto_hide=1" ]]; then + GRUB_STATE="${bold}Hidden${normal}" +elif [[ "$GRUB_STATE" == "menu_auto_hide=2" ]]; then + GRUB_STATE="${bold}Always Hidden${normal}" +else + GRUB_STATE="${bold}Unhidden${normal}" +fi +echo "${bold}Grub menu configuration${normal}" +echo "Grub menu is set to: $GRUB_STATE" +OPTION=$(Choose "Always Hide Grub" "Hide Grub" "Show Grub" "Cancel") +if [[ "${OPTION,,}" =~ ^always ]]; then + sudo grub2-editenv - set menu_auto_hide=2 + GRUB_STATE="${bold}Always Hidden${normal}" +elif [[ "${OPTION,,}" =~ ^hide ]]; then + sudo grub2-editenv - set menu_auto_hide=1 + GRUB_STATE="${bold}Hidden${normal}" +elif [[ "${OPTION,,}" =~ ^show ]]; then + sudo grub2-editenv - set menu_auto_hide=0 + GRUB_STATE="${bold}Unhidden${normal}" +else + echo "Not Changing Settings" +fi +echo "Grub menu is set to: $GRUB_STATE" \ No newline at end of file