mirror of
https://github.com/vinceliuice/grub2-themes.git
synced 2026-03-14 00:14:03 +08:00
add 1080p ultrawide support
This commit is contained in:
40
install.sh
40
install.sh
@@ -57,6 +57,7 @@ usage() {
|
||||
printf " %-25s%s\n" "-t, --tela" "tela grub theme"
|
||||
printf " %-25s%s\n" "-v, --vimix" "vimix grub theme"
|
||||
printf " %-25s%s\n" "-w, --white" "Install white icon version"
|
||||
printf " %-25s%s\n" "-u, --ultrawide" "Install 2560x1080 background image - not available for slaze grub theme"
|
||||
printf " %-25s%s\n" "-2, --2k" "Install 2k(2560x1440) background image"
|
||||
printf " %-25s%s\n" "-4, --4k" "Install 4k(3840x2160) background image"
|
||||
printf " %-25s%s\n" "-r, --remove" "Remove theme (must add theme name option)"
|
||||
@@ -83,16 +84,23 @@ install() {
|
||||
local screen="2k"
|
||||
elif [[ ${screen} == '4k' ]]; then
|
||||
local screen="4k"
|
||||
elif [[ ${screen} == '1080p_21:9' ]]; then
|
||||
local screen="1080p_21:9"
|
||||
else
|
||||
local screen="1080p"
|
||||
fi
|
||||
|
||||
if [[ ${screen} == '1080p_21:9' && ${name} == 'Slaze' ]]; then
|
||||
prompt -e "ultrawide 1080p does not support Slaze theme"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ${icon} == 'white' ]]; then
|
||||
local icon="white"
|
||||
else
|
||||
local icon="color"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# Checking for root access and proceed if it is present
|
||||
if [ "$UID" -eq "$ROOT_UID" ]; then
|
||||
clear
|
||||
@@ -104,11 +112,15 @@ install() {
|
||||
mkdir -p "${THEME_DIR}/${name}"
|
||||
|
||||
# Copy theme
|
||||
prompt -i "\n Installing ${name} ${screen} theme..."
|
||||
prompt -i "\n Installing ${name} ${icon} ${screen} theme..."
|
||||
|
||||
cp -a "${REO_DIR}/common/"* "${THEME_DIR}/${name}"
|
||||
cp -a "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${name}/theme.txt"
|
||||
cp -a "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${name}/background.jpg"
|
||||
if [[ ${screen} == '1080p_21:9' ]]; then
|
||||
cp -a "${REO_DIR}/backgrounds/${screen}/background-${theme}.png" "${THEME_DIR}/${name}/background.png"
|
||||
else
|
||||
cp -a "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${name}/background.jpg"
|
||||
fi
|
||||
cp -a "${REO_DIR}/assets/assets-${icon}/icons-${screen}" "${THEME_DIR}/${name}/icons"
|
||||
cp -a "${REO_DIR}/assets/assets-${icon}/select-${screen}/"*.png "${THEME_DIR}/${name}"
|
||||
|
||||
@@ -127,6 +139,8 @@ install() {
|
||||
# Make sure set the right resolution for grub
|
||||
if [[ ${screen} == '1080p' ]]; then
|
||||
echo "GRUB_GFXMODE=1920x1080,auto" >> /etc/default/grub
|
||||
elif [[ ${screen} == '1080p_21:9' ]]; then
|
||||
echo "GRUB_GFXMODE=2560x1080,auto" >> /etc/default/grub
|
||||
elif [[ ${screen} == '4k' ]]; then
|
||||
echo "GRUB_GFXMODE=3840x2160,auto" >> /etc/default/grub
|
||||
elif [[ ${screen} == '2k' ]]; then
|
||||
@@ -144,13 +158,13 @@ install() {
|
||||
# persisted execution of the script as root
|
||||
if [[ -n ${tui_root_login} ]] ; then
|
||||
if [[ -n "${theme}" && -n "${screen}" ]]; then
|
||||
sudo -S <<< ${tui_root_login} $0 --${theme} --${screen}
|
||||
sudo -S <<< ${tui_root_login} $0 ${ORIGINAL_ARGUMENTS}
|
||||
fi
|
||||
else
|
||||
read -p "[ Trusted ] Specify the root password : " -t${MAX_DELAY} -s
|
||||
[[ -n "$REPLY" ]] && {
|
||||
if [[ -n "${theme}" && -n "${screen}" ]]; then
|
||||
sudo -S <<< $REPLY $0 --${theme} --${screen}
|
||||
sudo -S <<< $REPLY $0 ${ORIGINAL_ARGUMENTS}
|
||||
fi
|
||||
} || {
|
||||
operation_canceled
|
||||
@@ -200,12 +214,14 @@ run_dialog() {
|
||||
tui=$(dialog --backtitle ${Project_Name} \
|
||||
--radiolist "Choose your Display Resolution : " 15 40 5 \
|
||||
1 "1080p" on \
|
||||
2 "2k" off \
|
||||
3 "4k" off --output-fd 1 )
|
||||
2 "1080p ultrawide" off \
|
||||
3 "2k" off \
|
||||
4 "4k" off --output-fd 1 )
|
||||
case "$tui" in
|
||||
1) screen="1080p" ;;
|
||||
2) screen="2k" ;;
|
||||
3) screen="4k" ;;
|
||||
2) screen="1080p_21:9" ;;
|
||||
3) screen="2k" ;;
|
||||
4) screen="4k" ;;
|
||||
*) operation_canceled ;;
|
||||
esac
|
||||
fi
|
||||
@@ -321,6 +337,7 @@ if [[ $# -lt 1 ]] && [[ $UID -ne $ROOT_UID ]] && [[ ! -x /usr/bin/dialog ]] ; t
|
||||
fi
|
||||
|
||||
while [[ $# -ge 1 ]]; do
|
||||
ORIGINAL_ARGUMENTS="$ORIGINAL_ARGUMENTS $1"
|
||||
case "${1}" in
|
||||
-b|--boot)
|
||||
THEME_DIR="/boot/grub/themes"
|
||||
@@ -352,6 +369,9 @@ while [[ $# -ge 1 ]]; do
|
||||
-4|--4k)
|
||||
screen='4k'
|
||||
;;
|
||||
-u|--ultrawide|--1080p_21:9)
|
||||
screen='1080p_21:9'
|
||||
;;
|
||||
-r|--remove)
|
||||
remove='true'
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user