grub2-themes/grub-theme-vimix/Install

48 lines
1.3 KiB
Plaintext
Raw Normal View History

2017-12-19 05:17:31 +01:00
#!/bin/bash
# Vimix - Grub2 Flat Theme
2017-12-19 05:17:31 +01:00
ROOT_UID=0
# Welcome message
echo -e "\n\t******************************\n\t* Vimix - Grub2 Flat Theme *\n\t******************************"
# Check command avalibility
2018-05-22 13:05:27 +02:00
function has_command() {
2019-02-11 07:03:32 +01:00
command -v $1 > /dev/null
2018-05-22 13:05:27 +02:00
}
echo -e "\nChecking for root access..."
# Checking for root access and proceed if it is present
2017-12-19 05:17:31 +01:00
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
2017-12-19 05:17:31 +01:00
# Copy Vimix
echo -e "Installing Vimix theme..."
2017-12-19 05:17:31 +01:00
cp -a Vimix /boot/grub/themes
# Set Vimix
echo -e "Setting Vimix as default..."
2017-12-19 05:17:31 +01:00
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..."
2018-05-22 13:05:27 +02:00
if has_command update-grub; then
update-grub
elif has_command grub-mkconfig; then
grub-mkconfig -o /boot/grub/grub.cfg
fi
2017-12-19 05:17:31 +01:00
# Success message
echo -e "\n\t ***************\n\t * All done! *\n\t ***************\n"
2017-12-19 05:17:31 +01:00
else
# Error message
echo -e "\n\t******************************\n\t* Error! -> Run me as root *\n\t******************************\n"
2017-12-19 05:17:31 +01:00
fi