i proposal for new version and new little code (maybe best all resolve bugs)..?
Created by: manuelsongokuh
hi i wish to talk for fix your code grub2 theme:
the start of code, you put new code: "what is your Distros use?" (opensuse, ubuntu, fedora, etc etc, show list available)
user reply: if user reply : 'opensuse' so directory path is "grub2-mkconfig -o /boot/grub2/grub.cfg" (this is for opensuse) so means this is works safety for all distros..right?
because i did download last you code github and i try install my opensuse not works so i look your code and i did patched for my opensuse..
** _prompt -i "\n Updating grub config..._"**
elif has_command grub2-mkconfig; then
#maunel_songokuh edit for my opensuse 15.2:
#grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg this is from github original, but this is for fedora..
grub2-mkconfig -o /boot/grub2/grub.cfg #this is my fix: for opensuse 15.2
fi
**_prompt -i "\n Resetting grub theme...\n"_**
#maunel_songokuh edit for my opensuse 15.2:
#grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg this is from github original, but this is for fedora..
grub2-mkconfig -o /boot/grub2/grub.cfg #this is my fix: for opensuse 15.2
fi
for idea: start of code: put question:
"what is your Distros use?"
for now available: opensuse, ubuntu, fedora,windows..."
you write one of this list:?"
in code of "what is your distros use?":
read "what is your distros use? for now available: opensuse, ubuntu, fedora,windows...
you write one of this list:?" user_reply
initial of code put here:
ROOT_UID=0
THEME_DIR="/usr/share/grub/themes"
COMMAND-GRUB1="/boot/grub/grub.cfg"
COMMAND-GRUB2="grub2-mkconfig -o /boot/grub2/grub.cfg"
COMMAND-FEDORA="grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg"
(@vinceliuice you can write and add other path if future new path of grub, will be easy for you :-) )
also fix for IF and FI:
# Update grub config
prompt -i "\n Updating grub config..."
if [ $user_reply == 'ubuntu' 'kubuntu' ]; then
[[$COMMAND-GRUB1]]
elif [ $user_reply == 'opensuse' ]; then
[[$COMMAND-GRUB2]]
elif [ $user_reply == 'fedora' ]; then
[[$COMMAND-FEDORA]]
fi
(@vinceliuice you can write add other distros this is easy for future new distro ;-) )
@vinceliuice better add data time in backup of file.. (not file.bak) better see here:
# Backup grub config
cp -an /etc/default/grub /etc/default/grub--${date +%F+%T}--grub2-themes.bak