11 Commits
Author SHA1 Message Date
Vince 4c5a77125b Merge pull request #254 from artempavlov/fix-243-dejavu-font
Fix bitmap-looking menu font by restoring DejaVu Sans
2026-09-01 22:09:02 +08:00
Artem Pavlov 3ac5284468 Fixed #243: restore DejaVu Sans font 2026-08-29 10:31:01 +02:00
Vince 241d3be041 Merge pull request #251 from Alexander-Hou/fix-imagemagick-v6-compat
fix: use convert as fallback for imagemagick v6
2026-08-12 09:41:05 +08:00
Cling 964b323d7c fix: use convert as fallback for imagemagick v6 2026-02-22 05:31:28 +08:00
vinceliuice 80dd04ddf3 Fixed #249 2025-09-06 13:23:39 +08:00
vinceliuice 8f30385f55 Update README.md 2025-08-28 19:52:00 +08:00
vinceliuice 6f235a8bc5 Update install.sh 2025-08-17 12:20:45 +08:00
vinceliuice 03d8c9cf0d Fixed #247 2025-08-13 16:01:31 +08:00
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
15 changed files with 149 additions and 36 deletions
+22 -1
View File
@@ -86,7 +86,7 @@ After that, you can configure the theme as shown below. In this example it is in
- Finally, run `grub-mkconfig -o /boot/grub/grub.cfg` to update your grub config - Finally, run `grub-mkconfig -o /boot/grub/grub.cfg` to update your grub config
### Setting a custom background: ### Setting a custom background:
- Make sure you have `imagemagick` installed, or at least something that provides `convert` - Make sure you have `imagemagick` installed, or at least something that provides `convert` or `magick`
- Find the resolution of your display, and make sure your background matches the resolution - Find the resolution of your display, and make sure your background matches the resolution
- 1920x1080 >> 1080p - 1920x1080 >> 1080p
- 2560x1080 >> ultrawide - 2560x1080 >> ultrawide
@@ -98,6 +98,27 @@ After that, you can configure the theme as shown below. In this example it is in
- Make sure to replace `[YOUR_RESOLUTION]` with your resolution and `[THEME]` with the theme - Make sure to replace `[YOUR_RESOLUTION]` with your resolution and `[THEME]` with the theme
- Alternatively, use the `-c` option to set a custom resolution - Alternatively, use the `-c` option to set a custom resolution
### Fonts:
GRUB themes use the PF2 font format. GRUB rasterizes a TrueType or OpenType
font when `grub-mkfont` creates a PF2 file, so the source font must be converted
for each size used by the theme. The bundled themes use the DejaVu Sans files
from `common/DejaVuSans.ttf`; Unifont is also included for broad Unicode
coverage.
To regenerate the bundled fonts, run:
```sh
cd common
./makefont.sh
```
The script supports both command names used by Linux distributions:
`grub-mkfont` (including NixOS) and `grub2-mkfont` (including Fedora and
openSUSE). To convert another font, pass its path, an output prefix, and
optional sizes:
```sh
./makefont.sh /path/to/MyFont.ttf my-font 16 24 32
```
## Contributing: ## Contributing:
- If you made changes to icons, or added a new one: - If you made changes to icons, or added a new one:
- Delete the existing icon, if there is one - Delete the existing icon, if there is one
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+51 -3
View File
@@ -1,5 +1,53 @@
#!/usr/bin/env bash #!/usr/bin/env bash
grub2-mkfont -o unifont-16.pf2 -s 16 unifont.otf set -o errexit
grub2-mkfont -o unifont-24.pf2 -s 24 unifont.otf set -o nounset
grub2-mkfont -o unifont-32.pf2 -s 32 unifont.otf set -o pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_DIR
if [[ -n "${GRUB_MKFONT:-}" ]]; then
readonly FONT_TOOL="${GRUB_MKFONT}"
elif command -v grub-mkfont >/dev/null 2>&1; then
readonly FONT_TOOL="grub-mkfont"
elif command -v grub2-mkfont >/dev/null 2>&1; then
readonly FONT_TOOL="grub2-mkfont"
else
printf 'error: grub-mkfont or grub2-mkfont is required\n' >&2
exit 1
fi
generate_font() {
local font_file="$1"
local output_prefix="$2"
shift 2
for size in "$@"; do
"${FONT_TOOL}" \
--output "${SCRIPT_DIR}/${output_prefix}-${size}.pf2" \
--size "${size}" \
"${font_file}"
done
}
usage() {
printf 'Usage: %s [FONT_FILE OUTPUT_PREFIX [SIZE ...]]\n' "$(basename "$0")" >&2
printf 'Without arguments, regenerate the bundled DejaVu Sans and Unifont files.\n' >&2
}
if (( $# == 0 )); then
generate_font "${SCRIPT_DIR}/DejaVuSans.ttf" dejavu_sans 12 14 16 24 32 48
generate_font "${SCRIPT_DIR}/unifont.otf" unifont 16 24 32
elif (( $# >= 2 )); then
font_file="$1"
output_prefix="$2"
shift 2
if (( $# == 0 )); then
set -- 16 24 32
fi
generate_font "${font_file}" "${output_prefix}" "$@"
else
usage
exit 2
fi
+2 -2
View File
@@ -19,7 +19,7 @@ terminal-border: "0"
top = 30% top = 30%
width = 40% width = 40%
height = 40% height = 40%
item_font = "Unifont Regular 16" item_font = "DejaVu Sans Regular 16"
item_color = "#cccccc" item_color = "#cccccc"
selected_item_color = "#ffffff" selected_item_color = "#ffffff"
icon_width = 32 icon_width = 32
@@ -48,5 +48,5 @@ terminal-border: "0"
id = "__timeout__" id = "__timeout__"
text = "Booting in %d seconds" text = "Booting in %d seconds"
color = "#cccccc" color = "#cccccc"
font = "Unifont Regular 16" font = "DejaVu Sans Regular 16"
} }
+2 -2
View File
@@ -19,7 +19,7 @@ terminal-border: "0"
top = 30% top = 30%
width = 40% width = 40%
height = 40% height = 40%
item_font = "Unifont Regular 24" item_font = "DejaVu Sans Regular 24"
item_color = "#cccccc" item_color = "#cccccc"
selected_item_color = "#ffffff" selected_item_color = "#ffffff"
icon_width = 48 icon_width = 48
@@ -48,5 +48,5 @@ terminal-border: "0"
id = "__timeout__" id = "__timeout__"
text = "Booting in %d seconds" text = "Booting in %d seconds"
color = "#cccccc" color = "#cccccc"
font = "Unifont Regular 24" font = "DejaVu Sans Regular 24"
} }
+2 -2
View File
@@ -19,7 +19,7 @@ terminal-border: "0"
top = 30% top = 30%
width = 40% width = 40%
height = 40% height = 40%
item_font = "Unifont Regular 32" item_font = "DejaVu Sans Regular 32"
item_color = "#cccccc" item_color = "#cccccc"
selected_item_color = "#ffffff" selected_item_color = "#ffffff"
icon_width = 64 icon_width = 64
@@ -48,5 +48,5 @@ terminal-border: "0"
id = "__timeout__" id = "__timeout__"
text = "Booting in %d seconds" text = "Booting in %d seconds"
color = "#cccccc" color = "#cccccc"
font = "Unifont Regular 32" font = "DejaVu Sans Regular 32"
} }
+2 -2
View File
@@ -19,7 +19,7 @@ terminal-border: "0"
top = 30% top = 30%
width = 40% width = 40%
height = 40% height = 40%
item_font = "Unifont Regular 16" item_font = "DejaVu Sans Regular 16"
item_color = "#cccccc" item_color = "#cccccc"
selected_item_color = "#ffffff" selected_item_color = "#ffffff"
icon_width = 32 icon_width = 32
@@ -48,5 +48,5 @@ terminal-border: "0"
id = "__timeout__" id = "__timeout__"
text = "Booting in %d seconds" text = "Booting in %d seconds"
color = "#cccccc" color = "#cccccc"
font = "Unifont Regular 16" font = "DejaVu Sans Regular 16"
} }
+2 -2
View File
@@ -19,7 +19,7 @@ terminal-border: "0"
top = 30% top = 30%
width = 40% width = 40%
height = 40% height = 40%
item_font = "Unifont Regular 24" item_font = "DejaVu Sans Regular 24"
item_color = "#cccccc" item_color = "#cccccc"
selected_item_color = "#ffffff" selected_item_color = "#ffffff"
icon_width = 48 icon_width = 48
@@ -48,5 +48,5 @@ terminal-border: "0"
id = "__timeout__" id = "__timeout__"
text = "Booting in %d seconds" text = "Booting in %d seconds"
color = "#cccccc" color = "#cccccc"
font = "Unifont Regular 24" font = "DejaVu Sans Regular 24"
} }
+61 -17
View File
@@ -1,5 +1,12 @@
#! /usr/bin/env bash #! /usr/bin/env bash
# Define which command to use for ImageMagick
if command -v magick &> /dev/null; then
_MAGICK="magick"
else
_MAGICK="convert"
fi
# Exit Immediately if a command fails # Exit Immediately if a command fails
set -o errexit set -o errexit
@@ -116,13 +123,18 @@ generate() {
# Determine which configuration file and assets to use # Determine which configuration file and assets to use
if [[ -n "$custom_resolution" ]]; then if [[ -n "$custom_resolution" ]]; then
if has_command apt || has_command pacman || has_command eopkg; then
install_depends imagemagick
else
install_depends ImageMagick
fi
asset_type=$(get_asset_type "$custom_resolution") asset_type=$(get_asset_type "$custom_resolution")
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${asset_type}.txt" "${THEME_DIR}/${theme}/theme.txt" cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${asset_type}.txt" "${THEME_DIR}/${theme}/theme.txt"
# Replace resolution in theme.txt # Replace resolution in theme.txt
sed -i "s/[0-9]\+x[0-9]\+/${custom_resolution}/" "${THEME_DIR}/${theme}/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 # 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" 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 else
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${theme}/theme.txt" 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" cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
@@ -130,9 +142,14 @@ generate() {
# Use custom background.jpg as grub background image # Use custom background.jpg as grub background image
if [[ -f "${REO_DIR}/background.jpg" ]]; then if [[ -f "${REO_DIR}/background.jpg" ]]; then
if has_command apt || has_command pacman || has_command eopkg; then
install_depends imagemagick
else
install_depends ImageMagick
fi
prompt -w "\n Using custom background.jpg as grub background image..." 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" 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}" "${THEME_DIR}/${theme}/background.jpg" -auto-orient "${THEME_DIR}/${theme}/background.jpg"
fi fi
# Determine which assets to use based on custom resolution or screen # Determine which assets to use based on custom resolution or screen
@@ -213,11 +230,8 @@ install() {
fi fi
if grep "GRUB_BACKGROUND=" /etc/default/grub 2>&1 >/dev/null; then if grep "GRUB_BACKGROUND=" /etc/default/grub 2>&1 >/dev/null; then
#Replace GRUB_BACKGROUND # remove GRUB_BACKGROUND
sed -i "s|.*GRUB_BACKGROUND=.*|GRUB_BACKGROUND=\"${THEME_DIR}/${theme}/background.jpg\"|" /etc/default/grub sed -i "s|.*GRUB_BACKGROUND=.*||" /etc/default/grub
else
#Append GRUB_BACKGROUND
echo "GRUB_BACKGROUND=\"${THEME_DIR}/${theme}/background.jpg\"" >> /etc/default/grub
fi fi
# Make sure the right resolution for grub is set # Make sure the right resolution for grub is set
@@ -267,11 +281,19 @@ install() {
#Check if password is cached (if cache timestamp has not expired yet) #Check if password is cached (if cache timestamp has not expired yet)
elif sudo -n true 2> /dev/null && echo; then elif sudo -n true 2> /dev/null && echo; then
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
if [[ "${install_boot}" == 'true' ]]; then if [[ "${install_boot}" == 'true' ]]; then
sudo "$0" -t ${theme} -i ${icon} -s ${screen} -b sudo "$0" -t ${theme} -i ${icon} -s ${screen} -b
else else
sudo "$0" -t ${theme} -i ${icon} -s ${screen} sudo "$0" -t ${theme} -i ${icon} -s ${screen}
fi fi
fi
else else
#Ask for password #Ask for password
if [[ -n ${tui_root_login} ]] ; then if [[ -n ${tui_root_login} ]] ; then
@@ -281,16 +303,30 @@ install() {
else else
sudo -S $0 -t ${theme} -i ${icon} -s ${screen} <<< ${tui_root_login} sudo -S $0 -t ${theme} -i ${icon} -s ${screen} <<< ${tui_root_login}
fi 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 fi
else else
prompt -e "\n [ Error! ] -> Run me as root! " prompt -e "\n [ Error! ] -> Run me as root! "
read -r -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s read -r -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s
if sudo -S echo <<< $REPLY 2> /dev/null && echo; then if sudo -S echo <<< $REPLY 2> /dev/null && echo; then
#Correct password, use with sudo's stdin #Correct password, use with sudo's stdin
if [[ -n "$custom_resolution" ]]; then
if [[ "${install_boot}" == 'true' ]]; then if [[ "${install_boot}" == 'true' ]]; then
sudo -S "$0" -t ${theme} -i ${icon} -s ${screen} -b <<< ${REPLY} sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution} -b <<< ${REPLY}
else else
sudo -S "$0" -t ${theme} -i ${icon} -s ${screen} <<< ${REPLY} sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution} <<< ${REPLY}
fi
else
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 fi
else else
#block for 3 seconds before allowing another attempt #block for 3 seconds before allowing another attempt
@@ -415,22 +451,30 @@ updating_grub() {
function install_program () { function install_program () {
if has_command zypper; then if has_command zypper; then
zypper in "$@" zypper in -y "$@"
elif has_command swupd; then
swupd bundle-add "$@"
elif has_command apt-get; then elif has_command apt-get; then
apt-get install "$@" apt-get install "$@"
elif has_command dnf; then elif has_command dnf; then
dnf install -y "$@" dnf install -y "$@"
elif has_command yum; then elif has_command yum; then
yum install "$@" yum install -y "$@"
elif has_command pacman; then elif has_command pacman; then
pacman -S --noconfirm "$@" pacman -Syyu --noconfirm --needed "$@"
elif has_command xbps-install; then
xbps-install -Sy "$@"
elif has_command eopkg; then
eopkg -y install "$@"
fi fi
} }
install_dialog() { install_depends() {
if [ ! "$(which dialog 2> /dev/null)" ]; then local depend=${1}
prompt -w "\n 'dialog' need to be installed for this shell"
install_program "dialog" if [ ! "$(which '${depend}' 2> /dev/null)" ]; then
prompt -w "\n '${depend}' need to be installed for this shell"
install_program "${depend}"
fi fi
} }
@@ -537,7 +581,7 @@ dialog_installer() {
fi fi
fi fi
fi fi
install_dialog install_depends dialog
fi fi
run_dialog run_dialog
install "${theme}" "${icon}" "${screen}" install "${theme}" "${icon}" "${screen}"