From e693282da6a3542904e0e86531ebb043e8d5fdfb Mon Sep 17 00:00:00 2001 From: vinceliuice Date: Tue, 22 May 2018 19:05:27 +0800 Subject: [PATCH] Fixed install bug --- README.md | 4 ++-- grub-themes-stylishdark/Install | 8 +++----- grub-themes-vimix/Install | 17 ++++++++++++----- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 91d7b5f..d065e42 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ OrOpen the terminal at current directory. Run - ./Install + sudo ./Install By Root user -### GRUB2 +## Screenshot ![01](https://github.com/vinceliuice/grub2-themes/blob/master/screenshot-vimix.jpeg?raw=true)  ![02](https://github.com/vinceliuice/grub2-themes/blob/master/screenshot-stylish.jpeg?raw=true)  diff --git a/grub-themes-stylishdark/Install b/grub-themes-stylishdark/Install index d577e39..f0f9c28 100755 --- a/grub-themes-stylishdark/Install +++ b/grub-themes-stylishdark/Install @@ -12,14 +12,12 @@ if [ "$UID" -eq "$ROOT_UID" ]; then echo "GRUB_THEME=\"/boot/grub/themes/StylishDark/theme.txt\"" >> /etc/default/grub # update grub - update-grub + grub-mkconfig -o /boot/grub/grub.cfg - echo -e "/n All done!" - notify-send "All done!" -i face-smile + echo -e "\n All done!" else - echo -e "/n Please run this script by root..." - notify-send "Please run this script by root..." -i notification + echo -e "\n Please run this script by root..." fi diff --git a/grub-themes-vimix/Install b/grub-themes-vimix/Install index 1848fcf..c95b0b5 100755 --- a/grub-themes-vimix/Install +++ b/grub-themes-vimix/Install @@ -2,6 +2,11 @@ ROOT_UID=0 +# check command avalibility +function has_command() { + command -v $1 > /dev/null +} + if [ "$UID" -eq "$ROOT_UID" ]; then # Copy Vimix @@ -12,14 +17,16 @@ if [ "$UID" -eq "$ROOT_UID" ]; then echo "GRUB_THEME=\"/boot/grub/themes/Vimix/theme.txt\"" >> /etc/default/grub # update grub - update-grub + 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!" - notify-send "All done!" -i face-smile + echo -e "\n All done!" else - echo -e "/n Please run this script by root..." - notify-send "Please run this script by root..." -i notification + echo -e "\n Please run this script by root..." fi