diff --git a/README.md b/README.md index 307adf2..2663dd9 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ OrOpen the terminal at current directory. Run - sudo ./Install + sudo ./install.sh -Or use Root user run ./Install +Or use Root user run ./install.sh ## Screenshots ![01](https://github.com/vinceliuice/grub2-themes/blob/master/screenshot-vimix.jpeg?raw=true)  diff --git a/grub-theme-slaze/Install b/grub-theme-slaze/Install deleted file mode 100755 index 25031b2..0000000 --- a/grub-theme-slaze/Install +++ /dev/null @@ -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 diff --git a/grub-theme-slaze/install.sh b/grub-theme-slaze/install.sh new file mode 100755 index 0000000..e7d05b2 --- /dev/null +++ b/grub-theme-slaze/install.sh @@ -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 diff --git a/grub-theme-stylishdark/Install b/grub-theme-stylishdark/Install deleted file mode 100755 index da6186b..0000000 --- a/grub-theme-stylishdark/Install +++ /dev/null @@ -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 diff --git a/grub-theme-stylishdark/install.sh b/grub-theme-stylishdark/install.sh new file mode 100755 index 0000000..a2bfe82 --- /dev/null +++ b/grub-theme-stylishdark/install.sh @@ -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 diff --git a/grub-theme-vimix/Install b/grub-theme-vimix/Install deleted file mode 100755 index 45d60c9..0000000 --- a/grub-theme-vimix/Install +++ /dev/null @@ -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 diff --git a/grub-theme-vimix/install.sh b/grub-theme-vimix/install.sh new file mode 100755 index 0000000..81d4679 --- /dev/null +++ b/grub-theme-vimix/install.sh @@ -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