From cfe0cd284fabe78fce9dbe071cdf97ad4bbe8467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20COUDERC?= Date: Wed, 9 Nov 2016 23:31:28 +0000 Subject: [PATCH] Include GRUB text/background colors in the theme pack / alternatives system. (Closes: #606383) --- Makefile | 3 -- debian/changelog | 2 + debian/postinst | 43 +++++++++++-------- debian/prerm | 22 ++++++++++ joy-theme/grub/Makefile | 2 +- joy-theme/grub/grub_background.sh | 3 ++ lines-theme/grub/Makefile | 2 +- {grub => lines-theme/grub}/grub_background.sh | 0 softwaves-theme/grub/Makefile | 2 +- softwaves-theme/grub/grub_background.sh | 3 ++ spacefun-theme/grub/Makefile | 2 +- spacefun-theme/grub/grub_background.sh | 3 ++ 12 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 joy-theme/grub/grub_background.sh rename {grub => lines-theme/grub}/grub_background.sh (100%) create mode 100644 softwaves-theme/grub/grub_background.sh create mode 100644 spacefun-theme/grub/grub_background.sh diff --git a/Makefile b/Makefile index 74ab348..b590056 100644 --- a/Makefile +++ b/Makefile @@ -79,9 +79,6 @@ install-local: mkdir -p $(DESTDIR)/usr/share/gnome-background-properties $(INSTALL) gnome-backgrounds.xml $(DESTDIR)/usr/share/gnome-background-properties/debian.xml - # grub - $(INSTALL) grub/grub_background.sh $(DESTDIR)/usr/share/desktop-base/ - # plymouth install -d $(DESTDIR)/usr/share/plymouth/themes/spacefun $(INSTALL) $(wildcard plymouth/spacefun/*) $(DESTDIR)/usr/share/plymouth/themes/spacefun diff --git a/debian/changelog b/debian/changelog index 423d85a..73ff153 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ desktop-base (9.0.0~exp2) UNRELEASED; urgency=medium * Remove Moreblue theme from Lenny. * Generate all GRUB bitmaps from SVG at build time instead of versionning them. + * Include GRUB text/background colors in the theme pack / alternatives + system. (Closes: #606383) * Fix detection of update-initramfs. (Closes: #843727) diff --git a/debian/postinst b/debian/postinst index 4157671..1297def 100644 --- a/debian/postinst +++ b/debian/postinst @@ -148,42 +148,51 @@ EOF desktop-sddm-preview \ /usr/share/desktop-base/joy-theme/sddm-preview.jpg - # Alternatives for grub + # Set up an alternative for the GRUB background/colors config # Highest priority for active theme ## Favor widescreen / hi-res background for efi installations num_grub_efi_installed=$(dpkg-query --list "grub-efi*" 2> /dev/null | grep "^i" | wc -l) if [ $num_grub_efi_installed -gt 0 ] ; then - grub_prio_4x3=15 - grub_prio_16x9=20 + grub_prio_4x3=45 + grub_prio_16x9=50 else - grub_prio_4x3=20 - grub_prio_16x9=15 + grub_prio_4x3=50 + grub_prio_16x9=45 fi update-alternatives --install \ /usr/share/images/desktop-base/desktop-grub.png \ desktop-grub \ - /usr/share/desktop-base/active-theme/grub/grub-4x3.png $grub_prio_4x3 + /usr/share/desktop-base/active-theme/grub/grub-4x3.png $grub_prio_4x3 \ + --slave /usr/share/desktop-base/grub_background.sh \ + desktop-grub.sh \ + /usr/share/desktop-base/active-theme/grub/grub_background.sh update-alternatives --install \ /usr/share/images/desktop-base/desktop-grub.png \ desktop-grub \ - /usr/share/desktop-base/active-theme/grub/grub-16x9.png $grub_prio_16x9 + /usr/share/desktop-base/active-theme/grub/grub-16x9.png $grub_prio_16x9 \ + --slave /usr/share/desktop-base/grub_background.sh \ + desktop-grub.sh \ + /usr/share/desktop-base/active-theme/grub/grub_background.sh # Alternatives for theme packages while read theme ratio priority; do update-alternatives --install /usr/share/images/desktop-base/desktop-grub.png \ desktop-grub \ - /usr/share/desktop-base/$theme-theme/grub/grub-$ratio.png $priority + /usr/share/desktop-base/$theme-theme/grub/grub-$ratio.png $priority \ + --slave /usr/share/desktop-base/grub_background.sh \ + desktop-grub.sh \ + /usr/share/desktop-base/$theme-theme/grub/grub_background.sh done << EOF -softwaves 4x3 15 -softwaves 16x9 15 -lines 4x3 14 -lines 16x9 14 -joy 4x3 14 -joy 16x9 14 -spacefun 4x3 14 -spacefun 16x9 14 +softwaves 4x3 40 +softwaves 16x9 40 +lines 4x3 30 +lines 16x9 30 +joy 4x3 30 +joy 16x9 30 +spacefun 4x3 30 +spacefun 16x9 30 EOF - # GRUB background + # Apply GRUB background update into /boot if which update-grub2 > /dev/null ; then # Ensure the background image file has actually been written to disc # before updating. diff --git a/debian/prerm b/debian/prerm index 8b6f593..da47132 100644 --- a/debian/prerm +++ b/debian/prerm @@ -123,6 +123,9 @@ EOF # Remove grub background alternatives # For theme packages while read theme ratio; do + update-alternatives --remove \ + desktop-grub.sh \ + /usr/share/desktop-base/$theme-theme/grub/grub_background.sh update-alternatives --remove \ desktop-grub \ /usr/share/desktop-base/$theme-theme/grub/grub-$ratio.png @@ -145,6 +148,9 @@ EOF remove_first_ratio=16x9 remove_last_ratio=4x3 fi + update-alternatives --remove \ + desktop-grub.sh \ + /usr/share/desktop-base/active-theme/grub/grub_background.sh update-alternatives --remove \ desktop-grub \ /usr/share/desktop-base/active-theme/grub/grub-$remove_first_ratio.png @@ -152,6 +158,22 @@ EOF desktop-grub \ /usr/share/desktop-base/active-theme/grub/grub-$remove_last_ratio.png + # Remove alternative for the GRUB background/colors config + # Alternatives for theme packages + while read theme priority; do + update-alternatives --remove \ + desktop-grub.sh \ + /usr/share/desktop-base/$theme-theme/grub/grub_background.sh + done << EOF +softwaves +lines +EOF + # *Lastly* remove *highest priority* alternative + update-alternatives --remove \ + desktop-grub.sh \ + /usr/share/desktop-base/active-theme/grub/grub_background.sh + + # Remove theme package alternatives while read theme; do update-alternatives --remove \ diff --git a/joy-theme/grub/Makefile b/joy-theme/grub/Makefile index 4869e1f..7c6135e 100644 --- a/joy-theme/grub/Makefile +++ b/joy-theme/grub/Makefile @@ -11,7 +11,7 @@ clean: install: install -d $(DESTDIR)/$(dir) - $(INSTALL) $(wildcard *.png) $(DESTDIR)/$(dir) + $(INSTALL) $(wildcard *.png *.sh) $(DESTDIR)/$(dir) grub-4x3.png: grub-4x3.svg rsvg-convert $< > $@ diff --git a/joy-theme/grub/grub_background.sh b/joy-theme/grub/grub_background.sh new file mode 100644 index 0000000..7ffa19d --- /dev/null +++ b/joy-theme/grub/grub_background.sh @@ -0,0 +1,3 @@ +WALLPAPER=/usr/share/images/desktop-base/desktop-grub.png +COLOR_NORMAL=light-gray/black +COLOR_HIGHLIGHT=black/white diff --git a/lines-theme/grub/Makefile b/lines-theme/grub/Makefile index 79be3aa..fd8077f 100644 --- a/lines-theme/grub/Makefile +++ b/lines-theme/grub/Makefile @@ -11,7 +11,7 @@ clean: install: install -d $(DESTDIR)/$(dir) - $(INSTALL) $(wildcard *.png) $(DESTDIR)/$(dir) + $(INSTALL) $(wildcard *.png *.sh) $(DESTDIR)/$(dir) grub-4x3.png: grub-4x3.svg rsvg-convert $< > $@ diff --git a/grub/grub_background.sh b/lines-theme/grub/grub_background.sh similarity index 100% rename from grub/grub_background.sh rename to lines-theme/grub/grub_background.sh diff --git a/softwaves-theme/grub/Makefile b/softwaves-theme/grub/Makefile index d952960..3a47ff0 100644 --- a/softwaves-theme/grub/Makefile +++ b/softwaves-theme/grub/Makefile @@ -11,7 +11,7 @@ clean: install: install -d $(DESTDIR)/$(dir) - $(INSTALL) $(wildcard *.png) $(DESTDIR)/$(dir) + $(INSTALL) $(wildcard *.png *.sh) $(DESTDIR)/$(dir) grub-4x3.png: grub-4x3.svg rsvg-convert $< > $@ diff --git a/softwaves-theme/grub/grub_background.sh b/softwaves-theme/grub/grub_background.sh new file mode 100644 index 0000000..c7ba469 --- /dev/null +++ b/softwaves-theme/grub/grub_background.sh @@ -0,0 +1,3 @@ +WALLPAPER=/usr/share/images/desktop-base/desktop-grub.png +COLOR_NORMAL=white/black +COLOR_HIGHLIGHT=black/white diff --git a/spacefun-theme/grub/Makefile b/spacefun-theme/grub/Makefile index 3274e5a..b0db697 100644 --- a/spacefun-theme/grub/Makefile +++ b/spacefun-theme/grub/Makefile @@ -11,7 +11,7 @@ clean: install: install -d $(DESTDIR)/$(dir) - $(INSTALL) $(wildcard *.png) $(DESTDIR)/$(dir) + $(INSTALL) $(wildcard *.png *.sh) $(DESTDIR)/$(dir) grub-4x3.png: grub-4x3.svg rsvg-convert $< > $@ diff --git a/spacefun-theme/grub/grub_background.sh b/spacefun-theme/grub/grub_background.sh new file mode 100644 index 0000000..1a0e99c --- /dev/null +++ b/spacefun-theme/grub/grub_background.sh @@ -0,0 +1,3 @@ +WALLPAPER=/usr/share/images/desktop-base/desktop-grub.png +COLOR_NORMAL=light-gray/black +COLOR_HIGHLIGHT=white/black