mirror of
https://github.com/vinceliuice/grub2-themes.git
synced 2024-12-25 21:05:34 +01:00
3046b944b3
Bug: If there is no 'themes' directory inside '/boot/grub/' then the Install script copies the contents of 'Vimix' directory to the root of '/boot/grub/themes' directory. Changes: Create 'themes' directory if not exists. Copied the 'has_command' function from the install script of Vimix to the install script of Stylish Dark. Also made some documentation changes and decorations :)
48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Vimix - Grub2 Flat Theme
|
|
|
|
ROOT_UID=0
|
|
|
|
# Welcome message
|
|
echo -e "\n\t******************************\n\t* Vimix - Grub2 Flat Theme *\n\t******************************"
|
|
|
|
# Check command avalibility
|
|
function has_command() {
|
|
command -v $1 > /dev/null
|
|
}
|
|
|
|
echo -e "\nChecking for root access..."
|
|
|
|
# Checking for root access and proceed if it is present
|
|
if [ "$UID" -eq "$ROOT_UID" ]; then
|
|
|
|
# Create themes directory if not exists
|
|
echo -e "Checking for the existence of themes directory..."
|
|
mkdir -p /boot/grub/themes
|
|
|
|
# Copy Vimix
|
|
echo -e "Installing Vimix theme..."
|
|
cp -a Vimix /boot/grub/themes
|
|
|
|
# Set Vimix
|
|
echo -e "Setting Vimix as default..."
|
|
grep "GRUB_THEME=" /etc/default/grub 2>&1 >/dev/null && sed -i '/GRUB_THEME=/d' /etc/default/grub
|
|
echo "GRUB_THEME=\"/boot/grub/themes/Vimix/theme.txt\"" >> /etc/default/grub
|
|
|
|
# Update grub config
|
|
echo -e "Updating grub config..."
|
|
if has_command update-grub; then
|
|
update-grub
|
|
elif has_command grub-mkconfig; then
|
|
grub-mkconfig -o /boot/grub/grub.cfg
|
|
fi
|
|
|
|
# Success message
|
|
echo -e "\n\t ***************\n\t * All done! *\n\t ***************\n"
|
|
|
|
else
|
|
# Error message
|
|
echo -e "\n\t******************************\n\t* Error! -> Run me as root *\n\t******************************\n"
|
|
fi
|