5 Commits

Author SHA1 Message Date
Vince 6c26f99622 Merge pull request #242 from aryankaran/patch-1
Fix background in terminal
2025-07-23 22:12:38 +08:00
vinceliuice 739cddf60f Fixed #244 2025-07-23 10:12:03 +08:00
Aryan Karan 7cf2f0918f Fix background in terminal
Becoz of GRUB_BACKGROUND being set it shows backkground in grub terminal too which is highly discouraged as it reduces visibilty of texts to 10-30%  

so better keep the terminal and other screen black expect the grub menu which is already set by theme  ```desktop-image```
2025-04-03 18:35:00 +05:30
vinceliuice f6ab2438e1 update 2024-12-17 13:22:01 +08:00
vinceliuice 42c232dfb4 Fixed #236 2024-10-27 12:54:41 +08:00
6 changed files with 54 additions and 31 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
desktop-color: "#000000"
terminal-font: "Terminus Regular 14"
terminal-box: "terminal_box_*.png"
terminal-left: "0"
terminal-top: "0"
#terminal-left: "0"
#terminal-top: "0"
terminal-width: "100%"
terminal-height: "100%"
terminal-border: "0"
+2 -2
View File
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
desktop-color: "#000000"
terminal-font: "Terminus Regular 18"
terminal-box: "terminal_box_*.png"
terminal-left: "0"
terminal-top: "0"
#terminal-left: "0"
#terminal-top: "0"
terminal-width: "100%"
terminal-height: "100%"
terminal-border: "0"
+2 -2
View File
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
desktop-color: "#000000"
terminal-font: "Terminus Regular 18"
terminal-box: "terminal_box_*.png"
terminal-left: "0"
terminal-top: "0"
#terminal-left: "0"
#terminal-top: "0"
terminal-width: "100%"
terminal-height: "100%"
terminal-border: "0"
+2 -2
View File
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
desktop-color: "#000000"
terminal-font: "Terminus Regular 14"
terminal-box: "terminal_box_*.png"
terminal-left: "0"
terminal-top: "0"
#terminal-left: "0"
#terminal-top: "0"
terminal-width: "100%"
terminal-height: "100%"
terminal-border: "0"
+2 -2
View File
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
desktop-color: "#000000"
terminal-font: "Terminus Regular 18"
terminal-box: "terminal_box_*.png"
terminal-left: "0"
terminal-top: "0"
#terminal-left: "0"
#terminal-top: "0"
terminal-width: "100%"
terminal-height: "100%"
terminal-border: "0"
+44 -21
View File
@@ -97,7 +97,7 @@ generate() {
prompt -i "\n Installing ${theme} ${icon} ${screen} theme..."
# Don't preserve ownership because the owner will be root, and that causes the script to crash if it is ran from terminal by sudo
cp -a --no-preserve=ownership "${REO_DIR}/common/"{*.png,*.pf2} "${THEME_DIR}/${theme}"
cp -a --no-preserve=ownership "${REO_DIR}/common/"*.pf2 "${THEME_DIR}/${theme}"
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${theme}/theme.txt"
cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
@@ -116,13 +116,14 @@ generate() {
# Determine which configuration file and assets to use
if [[ -n "$custom_resolution" ]]; then
install_depends ImageMagick
asset_type=$(get_asset_type "$custom_resolution")
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${asset_type}.txt" "${THEME_DIR}/${theme}/theme.txt"
# Replace resolution in theme.txt
sed -i "s/[0-9]\+x[0-9]\+/${custom_resolution}/" "${THEME_DIR}/${theme}/theme.txt"
# Use appropriate background as base and resize it
cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${asset_type}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
convert "${THEME_DIR}/${theme}/background.jpg" -resize ${custom_resolution}^ -gravity center -extent ${custom_resolution} "${THEME_DIR}/${theme}/background.jpg"
magick "${THEME_DIR}/${theme}/background.jpg" -resize ${custom_resolution}^ -gravity center -extent ${custom_resolution} "${THEME_DIR}/${theme}/background.jpg"
else
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${theme}/theme.txt"
cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
@@ -130,9 +131,10 @@ generate() {
# Use custom background.jpg as grub background image
if [[ -f "${REO_DIR}/background.jpg" ]]; then
install_depends ImageMagick
prompt -w "\n Using custom background.jpg as grub background image..."
cp -a --no-preserve=ownership "${REO_DIR}/background.jpg" "${THEME_DIR}/${theme}/background.jpg"
convert -auto-orient "${THEME_DIR}/${theme}/background.jpg" "${THEME_DIR}/${theme}/background.jpg"
magick -auto-orient "${THEME_DIR}/${theme}/background.jpg" "${THEME_DIR}/${theme}/background.jpg"
fi
# Determine which assets to use based on custom resolution or screen
@@ -213,11 +215,8 @@ install() {
fi
if grep "GRUB_BACKGROUND=" /etc/default/grub 2>&1 >/dev/null; then
#Replace GRUB_BACKGROUND
sed -i "s|.*GRUB_BACKGROUND=.*|GRUB_BACKGROUND=\"${THEME_DIR}/${theme}/background.jpg\"|" /etc/default/grub
else
#Append GRUB_BACKGROUND
echo "GRUB_BACKGROUND=\"${THEME_DIR}/${theme}/background.jpg\"" >> /etc/default/grub
# remove GRUB_BACKGROUND
sed -i "s|.*GRUB_BACKGROUND=.*||" /etc/default/grub
fi
# Make sure the right resolution for grub is set
@@ -267,10 +266,18 @@ install() {
#Check if password is cached (if cache timestamp has not expired yet)
elif sudo -n true 2> /dev/null && echo; then
if [[ "${install_boot}" == 'true' ]]; then
sudo "$0" -t ${theme} -i ${icon} -s ${screen} -b
if [[ -n "$custom_resolution" ]]; then
if [[ "${install_boot}" == 'true' ]]; then
sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution} -b
else
sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution}
fi
else
sudo "$0" -t ${theme} -i ${icon} -s ${screen}
if [[ "${install_boot}" == 'true' ]]; then
sudo "$0" -t ${theme} -i ${icon} -s ${screen} -b
else
sudo "$0" -t ${theme} -i ${icon} -s ${screen}
fi
fi
else
#Ask for password
@@ -281,16 +288,30 @@ install() {
else
sudo -S $0 -t ${theme} -i ${icon} -s ${screen} <<< ${tui_root_login}
fi
elif [[ -n "$custom_resolution" ]]; then
if [[ "${install_boot}" == 'true' ]]; then
sudo -S $0 -t ${theme} -i ${icon} -c ${custom_resolution} -b <<< ${tui_root_login}
else
sudo -S $0 -t ${theme} -i ${icon} -c ${custom_resolution} <<< ${tui_root_login}
fi
fi
else
prompt -e "\n [ Error! ] -> Run me as root! "
read -r -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s
if sudo -S echo <<< $REPLY 2> /dev/null && echo; then
#Correct password, use with sudo's stdin
if [[ "${install_boot}" == 'true' ]]; then
sudo -S "$0" -t ${theme} -i ${icon} -s ${screen} -b <<< ${REPLY}
if [[ -n "$custom_resolution" ]]; then
if [[ "${install_boot}" == 'true' ]]; then
sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution} -b <<< ${REPLY}
else
sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution} <<< ${REPLY}
fi
else
sudo -S "$0" -t ${theme} -i ${icon} -s ${screen} <<< ${REPLY}
if [[ "${install_boot}" == 'true' ]]; then
sudo "$0" -t ${theme} -i ${icon} -s ${screen} -b <<< ${REPLY}
else
sudo "$0" -t ${theme} -i ${icon} -s ${screen} <<< ${REPLY}
fi
fi
else
#block for 3 seconds before allowing another attempt
@@ -402,9 +423,9 @@ updating_grub() {
fi
if [[ -f /boot/grub2/grub.cfg && -f /boot/efi/EFI/fedora/grub.cfg ]]; then
prompt -w "Under EFI, GRUB2 looks for its configuration in /boot/efi/EFI/fedora/grub.cfg,\n however the postinstall script of grub2-common installs a small shim which chains to the standard configuration at /boot/grub2/grub.cfg which is generated above.\n To reset this shim to defaults, delete the existing /boot/efi/EFI/fedora/grub.cfg and then reinstall grub2-common."
prompt -w "\n Under EFI, GRUB2 looks for its configuration in /boot/efi/EFI/fedora/grub.cfg,\n however the postinstall script of grub2-common installs a small shim which chains to the standard configuration at /boot/grub2/grub.cfg which is generated above.\n To reset this shim to defaults, delete the existing /boot/efi/EFI/fedora/grub.cfg and then reinstall grub2-common."
prompt -i "sudo rm -f /boot/efi/EFI/fedora/grub.cfg"
prompt -i "\n sudo rm -f /boot/efi/EFI/fedora/grub.cfg"
prompt -i "sudo dnf reinstall grub2-common"
fi
fi
@@ -427,10 +448,12 @@ function install_program () {
fi
}
install_dialog() {
if [ ! "$(which dialog 2> /dev/null)" ]; then
prompt -w "\n 'dialog' need to be installed for this shell"
install_program "dialog"
install_depends() {
local depend=${1}
if [ ! "$(which '${depend}' 2> /dev/null)" ]; then
prompt -w "\n '${depend}' need to be installed for this shell"
install_program "${depend}"
fi
}
@@ -537,7 +560,7 @@ dialog_installer() {
fi
fi
fi
install_dialog
install_depends dialog
fi
run_dialog
install "${theme}" "${icon}" "${screen}"