Fixed install issues for fedora

This commit is contained in:
vinceliuice 2019-05-29 16:19:06 +08:00
parent 85e670a854
commit 4795799af5
7 changed files with 176 additions and 143 deletions

View file

@ -10,9 +10,9 @@ OrOpen the terminal at current directory.
Run Run
sudo ./Install sudo ./install.sh
Or use Root user run ./Install Or use Root user run ./install.sh
## Screenshots ## Screenshots
![01](https://github.com/vinceliuice/grub2-themes/blob/master/screenshot-vimix.jpeg?raw=true)  ![01](https://github.com/vinceliuice/grub2-themes/blob/master/screenshot-vimix.jpeg?raw=true) 

View file

@ -1,47 +0,0 @@
#!/bin/bash
# Slaze - Grub2 Abstract Theme
ROOT_UID=0
# Welcome message
echo -e "\n\t**********************************\n\t* Slaze - Grub2 Abstract 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 Slaze
echo -e "Installing Slaze theme..."
cp -a Slaze /boot/grub/themes
# Set Slaze
echo -e "Setting Slaze 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/Slaze/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

58
grub-theme-slaze/install.sh Executable file
View file

@ -0,0 +1,58 @@
#!/bin/bash
# Grub2 Dark Theme
ROOT_UID=0
THEME_DIR="/boot/grub/themes"
THEME_DIR_2="/boot/grub2/themes"
THEME_NAME=Slaze
# Welcome message
echo -e "\n\t******************************\n\t* ${THEME_NAME} - 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..."
[[ -d ${THEME_DIR}/${THEME_NAME} ]] && rm -rf ${THEME_DIR}/${THEME_NAME}
[[ -d ${THEME_DIR_2}/${THEME_NAME} ]] && rm -rf ${THEME_DIR_2}/${THEME_NAME}
[[ -d /boot/grub ]] && mkdir -p ${THEME_DIR}
[[ -d /boot/grub2 ]] && mkdir -p ${THEME_DIR_2}
# Copy theme
echo -e "Installing ${THEME_NAME} theme..."
[[ -d /boot/grub ]] && cp -a ${THEME_NAME} ${THEME_DIR}
[[ -d /boot/grub2 ]] && cp -a ${THEME_NAME} ${THEME_DIR_2}
# Set theme
echo -e "Setting ${THEME_NAME} as default..."
grep "GRUB_THEME=" /etc/default/grub 2>&1 >/dev/null && sed -i '/GRUB_THEME=/d' /etc/default/grub
[[ -d /boot/grub ]] && echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub
[[ -d /boot/grub2 ]] && echo "GRUB_THEME=\"${THEME_DIR_2}/${THEME_NAME}/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
elif has_command grub2-mkconfig; then
grub2-mkconfig -o /boot/efi/EFI/fedora/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

View file

@ -1,47 +0,0 @@
#!/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 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

View file

@ -0,0 +1,58 @@
#!/bin/bash
# Grub2 Dark Theme
ROOT_UID=0
THEME_DIR="/boot/grub/themes"
THEME_DIR_2="/boot/grub2/themes"
THEME_NAME=StylishDark
# Welcome message
echo -e "\n\t************************************\n\t* ${THEME_NAME} - 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..."
[[ -d ${THEME_DIR}/${THEME_NAME} ]] && rm -rf ${THEME_DIR}/${THEME_NAME}
[[ -d ${THEME_DIR_2}/${THEME_NAME} ]] && rm -rf ${THEME_DIR_2}/${THEME_NAME}
[[ -d /boot/grub ]] && mkdir -p ${THEME_DIR}
[[ -d /boot/grub2 ]] && mkdir -p ${THEME_DIR_2}
# Copy theme
echo -e "Installing ${THEME_NAME} theme..."
[[ -d /boot/grub ]] && cp -a ${THEME_NAME} ${THEME_DIR}
[[ -d /boot/grub2 ]] && cp -a ${THEME_NAME} ${THEME_DIR_2}
# Set theme
echo -e "Setting ${THEME_NAME} as default..."
grep "GRUB_THEME=" /etc/default/grub 2>&1 >/dev/null && sed -i '/GRUB_THEME=/d' /etc/default/grub
[[ -d /boot/grub ]] && echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub
[[ -d /boot/grub2 ]] && echo "GRUB_THEME=\"${THEME_DIR_2}/${THEME_NAME}/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
elif has_command grub2-mkconfig; then
grub2-mkconfig -o /boot/efi/EFI/fedora/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

View file

@ -1,47 +0,0 @@
#!/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

58
grub-theme-vimix/install.sh Executable file
View file

@ -0,0 +1,58 @@
#!/bin/bash
# Grub2 Dark Theme
ROOT_UID=0
THEME_DIR="/boot/grub/themes"
THEME_DIR_2="/boot/grub2/themes"
THEME_NAME=Vimix
# Welcome message
echo -e "\n\t******************************\n\t* ${THEME_NAME} - 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..."
[[ -d ${THEME_DIR}/${THEME_NAME} ]] && rm -rf ${THEME_DIR}/${THEME_NAME}
[[ -d ${THEME_DIR_2}/${THEME_NAME} ]] && rm -rf ${THEME_DIR_2}/${THEME_NAME}
[[ -d /boot/grub ]] && mkdir -p ${THEME_DIR}
[[ -d /boot/grub2 ]] && mkdir -p ${THEME_DIR_2}
# Copy theme
echo -e "Installing ${THEME_NAME} theme..."
[[ -d /boot/grub ]] && cp -a ${THEME_NAME} ${THEME_DIR}
[[ -d /boot/grub2 ]] && cp -a ${THEME_NAME} ${THEME_DIR_2}
# Set theme
echo -e "Setting ${THEME_NAME} as default..."
grep "GRUB_THEME=" /etc/default/grub 2>&1 >/dev/null && sed -i '/GRUB_THEME=/d' /etc/default/grub
[[ -d /boot/grub ]] && echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub
[[ -d /boot/grub2 ]] && echo "GRUB_THEME=\"${THEME_DIR_2}/${THEME_NAME}/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
elif has_command grub2-mkconfig; then
grub2-mkconfig -o /boot/efi/EFI/fedora/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