mirror of
https://github.com/vinceliuice/grub2-themes.git
synced 2026-06-08 21:23:17 +08:00
Compare commits
4 Commits
55aef0cada
...
2025-03-03
| Author | SHA1 | Date | |
|---|---|---|---|
| f6ab2438e1 | |||
| 42c232dfb4 | |||
| 24ac05a101 | |||
| 92fc1c9686 |
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 14"
|
terminal-font: "Terminus Regular 14"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
|
|||||||
+2
-2
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 18"
|
terminal-font: "Terminus Regular 18"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
|
|||||||
+2
-2
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 18"
|
terminal-font: "Terminus Regular 18"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 14"
|
terminal-font: "Terminus Regular 14"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 18"
|
terminal-font: "Terminus Regular 18"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
|
|||||||
@@ -32,7 +32,15 @@
|
|||||||
src = "${self}";
|
src = "${self}";
|
||||||
buildInputs = [ pkgs.imagemagick ];
|
buildInputs = [ pkgs.imagemagick ];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/grub/themes;
|
mkdir -p $out/grub/themes
|
||||||
|
|
||||||
|
# Create placeholder terminal box PNGs that install.sh expects
|
||||||
|
mkdir -p common
|
||||||
|
for box in c e n ne nw s se sw w; do
|
||||||
|
touch common/terminal_box_$box.png
|
||||||
|
done
|
||||||
|
|
||||||
|
# Run the install script
|
||||||
bash ./install.sh \
|
bash ./install.sh \
|
||||||
--generate $out/grub/themes \
|
--generate $out/grub/themes \
|
||||||
--screen ${cfg.screen} \
|
--screen ${cfg.screen} \
|
||||||
@@ -44,9 +52,11 @@
|
|||||||
rm $out/grub/themes/${cfg.theme}/background.jpg;
|
rm $out/grub/themes/${cfg.theme}/background.jpg;
|
||||||
${pkgs.imagemagick}/bin/magick ${splashImage} $out/grub/themes/${cfg.theme}/background.jpg;
|
${pkgs.imagemagick}/bin/magick ${splashImage} $out/grub/themes/${cfg.theme}/background.jpg;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ ${pkgs.lib.trivial.boolToString cfg.footer} == "false" ]; then
|
if [ ${pkgs.lib.trivial.boolToString cfg.footer} == "false" ]; then
|
||||||
sed -i ':again;$!N;$!b again; s/\+ image {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt;
|
sed -i ':again;$!N;$!b again; s/\+ image {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ ${pkgs.lib.trivial.boolToString hasBootMenuConfig} == "true" ]; then
|
if [ ${pkgs.lib.trivial.boolToString hasBootMenuConfig} == "true" ]; then
|
||||||
sed -i ':again;$!N;$!b again; s/\+ boot_menu {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt;
|
sed -i ':again;$!N;$!b again; s/\+ boot_menu {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt;
|
||||||
cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt
|
cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt
|
||||||
@@ -55,6 +65,7 @@
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ ${pkgs.lib.trivial.boolToString hasTerminalConfig} == "true" ]; then
|
if [ ${pkgs.lib.trivial.boolToString hasTerminalConfig} == "true" ]; then
|
||||||
sed -i 's/^terminal-.*$//g' $out/grub/themes/${cfg.theme}/theme.txt
|
sed -i 's/^terminal-.*$//g' $out/grub/themes/${cfg.theme}/theme.txt
|
||||||
cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt
|
cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt
|
||||||
|
|||||||
+3
-3
@@ -97,7 +97,7 @@ generate() {
|
|||||||
prompt -i "\n Installing ${theme} ${icon} ${screen} theme..."
|
prompt -i "\n Installing ${theme} ${icon} ${screen} theme..."
|
||||||
|
|
||||||
# Don't preserve ownership because the owner will be root, and that causes the script to crash if it is ran from terminal by sudo
|
# Don't preserve ownership because the owner will be root, and that causes the script to crash if it is ran from terminal by sudo
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/common/"{*.png,*.pf2} "${THEME_DIR}/${theme}"
|
cp -a --no-preserve=ownership "${REO_DIR}/common/"*.pf2 "${THEME_DIR}/${theme}"
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${theme}/theme.txt"
|
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${theme}/theme.txt"
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
||||||
|
|
||||||
@@ -402,9 +402,9 @@ updating_grub() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /boot/grub2/grub.cfg && -f /boot/efi/EFI/fedora/grub.cfg ]]; then
|
if [[ -f /boot/grub2/grub.cfg && -f /boot/efi/EFI/fedora/grub.cfg ]]; then
|
||||||
prompt -w "Under EFI, GRUB2 looks for its configuration in /boot/efi/EFI/fedora/grub.cfg,\n however the postinstall script of grub2-common installs a small shim which chains to the standard configuration at /boot/grub2/grub.cfg which is generated above.\n To reset this shim to defaults, delete the existing /boot/efi/EFI/fedora/grub.cfg and then reinstall grub2-common."
|
prompt -w "\n Under EFI, GRUB2 looks for its configuration in /boot/efi/EFI/fedora/grub.cfg,\n however the postinstall script of grub2-common installs a small shim which chains to the standard configuration at /boot/grub2/grub.cfg which is generated above.\n To reset this shim to defaults, delete the existing /boot/efi/EFI/fedora/grub.cfg and then reinstall grub2-common."
|
||||||
|
|
||||||
prompt -i "sudo rm -f /boot/efi/EFI/fedora/grub.cfg"
|
prompt -i "\n sudo rm -f /boot/efi/EFI/fedora/grub.cfg"
|
||||||
prompt -i "sudo dnf reinstall grub2-common"
|
prompt -i "sudo dnf reinstall grub2-common"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user