Add option for theme install into /boot/grub/themes

This commit is contained in:
vinceliuice 2020-03-30 12:59:37 +08:00
parent 19125b85b9
commit eaa19c717b
2 changed files with 17 additions and 10 deletions

View File

@ -17,6 +17,7 @@ _if no option used the terminal user interface will be show up_
| OPTIONS: | description | | OPTIONS: | description |
|:---------------|:-------------| |:---------------|:-------------|
| -b, --boot | Install grub theme into /boot/grub/themes |
| -v, --vimix | Vimix grub theme | | -v, --vimix | Vimix grub theme |
| -s, --stylish | Stylish grub theme | | -s, --stylish | Stylish grub theme |
| -t, --tela | Tela grub theme | | -t, --tela | Tela grub theme |
@ -35,7 +36,11 @@ For example:
or or
`sudo ./install.sh --tela --2k` `sudo ./install.sh --tela --2k`
2. Remove Tela theme 2. Install Tela theme into /boot/grub/themes
`sudo ./install.sh -b -t`
3. Remove Tela theme
`sudo ./install.sh -r -t` `sudo ./install.sh -r -t`
@ -49,16 +54,16 @@ On the grub screen, `press c` to get the commandline, and enter `vbeinfo` or `vi
### Vimix grub theme ### Vimix grub theme
![vimix grub theme](https://github.com/vinceliuice/grub2-themes/blob/master/screenshots/grub-theme-vimix.jpg?raw=true "vimix grub theme") ![vimix grub theme](screenshots/grub-theme-vimix.jpg?raw=true)
### Stylish grub theme ### Stylish grub theme
![Stylish grub theme](https://github.com/vinceliuice/grub2-themes/blob/master/screenshots/grub-theme-stylish.jpg?raw=true) ![Stylish grub theme](screenshots/grub-theme-stylish.jpg?raw=true)
### Tela grub theme ### Tela grub theme
![Tela grub theme](https://github.com/vinceliuice/grub2-themes/blob/master/screenshots/grub-theme-tela.jpg?raw=true) ![Tela grub theme](screenshots/grub-theme-tela.jpg?raw=true)
### Slaze grub theme ### Slaze grub theme
![Slaze grub theme](https://github.com/vinceliuice/grub2-themes/blob/master/screenshots/grub-theme-slaze.jpg?raw=true) ![Slaze grub theme](screenshots/grub-theme-slaze.jpg?raw=true)

View File

@ -12,9 +12,7 @@ tui_root_login=
THEME_DIR="/usr/share/grub/themes" THEME_DIR="/usr/share/grub/themes"
REO_DIR="$(cd $(dirname $0) && pwd)" REO_DIR="$(cd $(dirname $0) && pwd)"
} }
#COLORS #COLORS
CDEF=" \033[0m" # default color CDEF=" \033[0m" # default color
@ -53,6 +51,7 @@ function has_command() {
usage() { usage() {
printf "%s\n" "Usage: ${0##*/} [OPTIONS...]" printf "%s\n" "Usage: ${0##*/} [OPTIONS...]"
printf "\n%s\n" "OPTIONS:" printf "\n%s\n" "OPTIONS:"
printf " %-25s%s\n" "-b, --boot" "install grub theme into /boot/grub/themes"
printf " %-25s%s\n" "-l, --slaze" "slaze grub theme" printf " %-25s%s\n" "-l, --slaze" "slaze grub theme"
printf " %-25s%s\n" "-s, --stylish" "stylish grub theme" printf " %-25s%s\n" "-s, --stylish" "stylish grub theme"
printf " %-25s%s\n" "-t, --tela" "tela grub theme" printf " %-25s%s\n" "-t, --tela" "tela grub theme"
@ -137,7 +136,7 @@ install() {
prompt -i "\n Updating grub config..." prompt -i "\n Updating grub config..."
updating_grub updating_grub
else else
# Error message # Error message
prompt -e "\n [ Error! ] -> Run me as root! " prompt -e "\n [ Error! ] -> Run me as root! "
@ -146,7 +145,7 @@ install() {
if [[ -n "${theme}" && -n "${screen}" ]]; then if [[ -n "${theme}" && -n "${screen}" ]]; then
sudo -S <<< ${tui_root_login} $0 --${theme} --${screen} sudo -S <<< ${tui_root_login} $0 --${theme} --${screen}
fi fi
else else
read -p "[ Trusted ] Specify the root password : " -t${MAX_DELAY} -s read -p "[ Trusted ] Specify the root password : " -t${MAX_DELAY} -s
[[ -n "$REPLY" ]] && { [[ -n "$REPLY" ]] && {
if [[ -n "${theme}" && -n "${screen}" ]]; then if [[ -n "${theme}" && -n "${screen}" ]]; then
@ -154,7 +153,7 @@ install() {
fi fi
} || { } || {
operation_canceled operation_canceled
} }
fi fi
fi fi
@ -322,6 +321,9 @@ fi
while [[ $# -ge 1 ]]; do while [[ $# -ge 1 ]]; do
case "${1}" in case "${1}" in
-b|--boot)
THEME_DIR="/boot/grub/themes"
;;
-l|--slaze) -l|--slaze)
theme='slaze' theme='slaze'
;; ;;