Merge pull request #200 from hotime/patch-1

fix: the old background reappears for a few seconds
This commit is contained in:
Vince 2023-08-01 21:54:20 +08:00 committed by GitHub
commit 02ec0a888b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,6 +181,14 @@ install() {
echo "GRUB_THEME=\"${THEME_DIR}/${theme}/theme.txt\"" >> /etc/default/grub echo "GRUB_THEME=\"${THEME_DIR}/${theme}/theme.txt\"" >> /etc/default/grub
fi 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 # Make sure the right resolution for grub is set
if [[ ${screen} == '1080p' ]]; then if [[ ${screen} == '1080p' ]]; then
gfxmode="GRUB_GFXMODE=1920x1080,auto" gfxmode="GRUB_GFXMODE=1920x1080,auto"