Merge pull request #10 from jackreez/master

Fixed fresh install bug
This commit is contained in:
Vince
2019-02-11 13:27:39 +08:00
committed by GitHub
51 changed files with 138 additions and 12 deletions

View File

@ -1,23 +1,47 @@
#!/bin/bash
# StylishDark - Grub2 Dark Theme
ROOT_UID=0
# Welcome message
echo -e "\n\t************************************\n\t* StylishDark - Grub2 Dark 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 StylishDark
echo -e "Installing Vimix theme..."
cp -a StylishDark /boot/grub/themes
# Set StylishDark
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/StylishDark/theme.txt\"" >> /etc/default/grub
# update grub
grub-mkconfig -o /boot/grub/grub.cfg
# 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
echo -e "\n All done!"
# Success message
echo -e "\n\t ***************\n\t * All done! *\n\t ***************\n"
else
echo -e "\n Please run this script by root..."
# Error message
echo -e "\n\t ******************************\n\t * Error! -> Run me as root *\n\t ******************************\n"
fi