From cd5fee45821aec7a89047c9e1a279604a2c0ccf6 Mon Sep 17 00:00:00 2001 From: hotime <41103047+hotime@users.noreply.github.com> Date: Tue, 1 Aug 2023 18:55:38 +0800 Subject: [PATCH] fix: the old background reappears for a few seconds Add replacing or appending "GRUB_BACKGROUND" surpport for file "/etc/default/grub" to fix "the old background reappears for a few seconds" bug. --- install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install.sh b/install.sh index 962c911..411fa65 100755 --- a/install.sh +++ b/install.sh @@ -181,6 +181,14 @@ install() { echo "GRUB_THEME=\"${THEME_DIR}/${theme}/theme.txt\"" >> /etc/default/grub fi + if grep "GRUB_BACKGROUND=" /etc/default/grub 2>&1 >/dev/null; then + #Replace GRUB_BACKGROUND + sed -i "s|.*GRUB_BACKGROUND=.*|GRUB_BACKGROUND=\"${THEME_DIR}/${theme}/background.jpg\"|" /etc/default/grub + else + #Append GRUB_BACKGROUND + echo "GRUB_BACKGROUND=\"${THEME_DIR}/${theme}/background.jpg\"" >> /etc/default/grub + fi + # Make sure the right resolution for grub is set if [[ ${screen} == '1080p' ]]; then gfxmode="GRUB_GFXMODE=1920x1080,auto"