Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add configure-grub just command #1206

Merged
merged 6 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions just/bluefin-system.just
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 26 additions & 0 deletions system_files/shared/usr/libexec/configure-grub.sh
Original file line number Diff line number Diff line change
@@ -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"
Loading