%global gitdate 20230415 %global gitrev 8cd0ea9 %global gitcommit %{gitdate}git%{gitrev} %global grubthemedir /boot/grub2/themes %global debug_package %{nil} Name: grub2-themes Version: 0 Release: 2%{?gitcommit:.%{gitcommit}}%{?dist} Summary: A collection of themes for Grub2 by vinceliuice License: GPLv3 URL: https://github.com/vinceliuice/grub2-themes Source0: %{name}-%{version}%{?gitcommit:-%{gitcommit}}.tar.xz BuildRequires: ImageMagick Requires: grub2-tools BuildArch: noarch %description A collection of themes for Grub2 by vinceliuice. %package 1080p Summary: A collection of 1080p themes for Grub2 by vinceliuice Requires: grub2-tools %description 1080p A collection of themes for Grub2 by vinceliuice. This package contains the themes that can be used at a 1080p screen resolution (1920x1080). %package ultrawide Summary: A collection of ultrawide themes for Grub2 by vinceliuice Requires: grub2-tools %description ultrawide A collection of themes for Grub2 by vinceliuice. This package contains the themes that can be used at an ultrawide screen resolution (2560x1080). %package 4k Summary: A collection of 4k themes for Grub2 by vinceliuice Requires: grub2-tools %description 4k A collection of themes for Grub2 by vinceliuice. This package contains the themes that can be used at a 4k screen resolution (3840x2160). %package 2k Summary: A collection of 2k themes for Grub2 by vinceliuice Requires: grub2-tools %description 2k A collection of themes for Grub2 by vinceliuice. This package contains the themes that can be used at a 2k screen resolution (2560x1440). %package ultrawide2k Summary: A collection of ultrawide2k themes for Grub2 by vinceliuice Requires: grub2-tools %description ultrawide2k A collection of themes for Grub2 by vinceliuice. This package contains the themes that can be used at a ultrawide2k screen resolution (3440x1440). %prep %autosetup -n %{name} %build for screen in 1080p 2k 4k ultrawide ultrawide2k; do if [[ ${screen} == '1080p' ]]; then gfxmode="GRUB_GFXMODE=1920x1080,auto" elif [[ ${screen} == 'ultrawide' ]]; then gfxmode="GRUB_GFXMODE=2560x1080,auto" elif [[ ${screen} == '4k' ]]; then gfxmode="GRUB_GFXMODE=3840x2160,auto" elif [[ ${screen} == '2k' ]]; then gfxmode="GRUB_GFXMODE=2560x1440,auto" elif [[ ${screen} == 'ultrawide2k' ]]; then gfxmode="GRUB_GFXMODE=3440x1440,auto" fi cat > README.${screen} << EOF To use this theme, edit %{_sysconfdir}/sysconfig/grub to include: GRUB_THEME="%{grubthemedir}/MYTHEME-MYICON-${screen}/theme.txt", where: MYTHEME is one of the following theme styles: stylish tela vimix whitesur MYICON is one of the following icon styles: color white whitesur Example: GRUB_THEME="%{grubthemedir}/tela-color-${screen}/theme.txt" Then comment-out the following line (by adding a '#' at the very beginning): GRUB_TERMINAL_OUTPUT="console" Then, add or edit the GRUB_GFXMODE variable as follows: ${gfxmode} Finally, run grub2-mkconfig -o /boot/grub2/grub.cfg EOF done %install for theme in tela vimix stylish whitesur; do for icon in color white whitesur; do for screen in 1080p 2k 4k ultrawide ultrawide2k; do ./install.sh -t ${theme} -i ${icon} -s ${screen} \ -g "$RPM_BUILD_ROOT%{grubthemedir}/${theme}-${icon}-${screen}" pushd "$RPM_BUILD_ROOT%{grubthemedir}/${theme}-${icon}-${screen}" mv ./${theme}/* . rm -rf ./${theme} popd done done done %files 1080p %license LICENSE %doc README.1080p %{grubthemedir}/*-*-1080p %files ultrawide %license LICENSE %doc README.ultrawide %{grubthemedir}/*-*-ultrawide %files 4k %license LICENSE %doc README.4k %{grubthemedir}/*-*-4k %files 2k %license LICENSE %doc README.2k %{grubthemedir}/*-*-2k %files ultrawide2k %license LICENSE %doc README.ultrawide2k %{grubthemedir}/*-*-ultrawide2k %changelog * Thu Jun 29 2023 Andrea Santilli - 0-2.20230415git8cd0ea9 - Modify the README.* files with more exact information. * Sat Jun 10 2023 Andrea Santilli - 0-1.20230415git8cd0ea9 - Initial RPM release.