Fixed fresh install bug
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 :)
This commit is contained in:
parent
c4527c73d9
commit
3046b944b3
2 changed files with 53 additions and 14 deletions
|
@ -1,23 +1,47 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# StylishDark - Grub2 Dark Theme
|
||||||
|
|
||||||
ROOT_UID=0
|
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
|
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
|
# Copy StylishDark
|
||||||
|
echo -e "Installing Vimix theme..."
|
||||||
cp -a StylishDark /boot/grub/themes
|
cp -a StylishDark /boot/grub/themes
|
||||||
|
|
||||||
# Set StylishDark
|
# 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
|
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
|
echo "GRUB_THEME=\"/boot/grub/themes/StylishDark/theme.txt\"" >> /etc/default/grub
|
||||||
|
|
||||||
# update grub
|
# Update grub config
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg
|
echo -e "Updating grub config..."
|
||||||
|
if has_command update-grub; then
|
||||||
echo -e "\n All done!"
|
update-grub
|
||||||
|
elif has_command grub-mkconfig; then
|
||||||
else
|
grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
echo -e "\n Please run this script by root..."
|
fi
|
||||||
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
|
||||||
|
|
|
@ -1,32 +1,47 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Vimix - Grub2 Flat Theme
|
||||||
|
|
||||||
ROOT_UID=0
|
ROOT_UID=0
|
||||||
|
|
||||||
# check command avalibility
|
# Welcome message
|
||||||
|
echo -e "\n\t******************************\n\t* Vimix - Grub2 Flat Theme *\n\t******************************"
|
||||||
|
|
||||||
|
# Check command avalibility
|
||||||
function has_command() {
|
function has_command() {
|
||||||
command -v $1 > /dev/null
|
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
|
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
|
# Copy Vimix
|
||||||
|
echo -e "Installing Vimix theme..."
|
||||||
cp -a Vimix /boot/grub/themes
|
cp -a Vimix /boot/grub/themes
|
||||||
|
|
||||||
# Set Vimix
|
# 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
|
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
|
echo "GRUB_THEME=\"/boot/grub/themes/Vimix/theme.txt\"" >> /etc/default/grub
|
||||||
|
|
||||||
# update grub
|
# Update grub config
|
||||||
|
echo -e "Updating grub config..."
|
||||||
if has_command update-grub; then
|
if has_command update-grub; then
|
||||||
update-grub
|
update-grub
|
||||||
elif has_command grub-mkconfig; then
|
elif has_command grub-mkconfig; then
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg
|
grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n All done!"
|
# Success message
|
||||||
|
echo -e "\n\t ***************\n\t * All done! *\n\t ***************\n"
|
||||||
|
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue