110 lines
3.8 KiB
Bash
110 lines
3.8 KiB
Bash
#!/bin/bash -e
|
|
set -e
|
|
|
|
if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl 7; then
|
|
update-alternatives --remove desktop-grub /usr/share/images/desktop-base/moreblue-orbit-grub.png
|
|
fi
|
|
|
|
if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
|
|
# Alternatives for the background
|
|
while read background priority; do
|
|
update-alternatives --install \
|
|
/usr/share/images/desktop-base/desktop-background \
|
|
desktop-background \
|
|
/usr/share/images/desktop-base/$background $priority
|
|
done << EOF
|
|
lines-wallpaper_1280x1024.svg 65
|
|
lines-wallpaper_1600x1200.svg 65
|
|
lines-wallpaper_1920x1080.svg 70
|
|
lines-wallpaper_1920x1200.svg 65
|
|
lines-wallpaper_2560x1080.svg 65
|
|
joy-wallpaper_1600x1200.svg 60
|
|
joy-wallpaper_1280x1024.svg 60
|
|
joy-wallpaper_1920x1080.svg 60
|
|
joy-wallpaper_1920x1200.svg 60
|
|
joy-inksplat-wallpaper_1920x1080.svg 60
|
|
spacefun-wallpaper.svg 50
|
|
spacefun-wallpaper-widescreen.svg 50
|
|
moreblue-orbit-wallpaper.svg 40
|
|
moreblue-orbit-wallpaper-widescreen.svg 40
|
|
EOF
|
|
|
|
# Set up an alternative for the XML version of the background
|
|
# (for GNOME)
|
|
while read desktopbackground priority; do
|
|
update-alternatives --install \
|
|
/usr/share/images/desktop-base/desktop-background.xml \
|
|
desktop-background.xml \
|
|
/usr/share/images/desktop-base/$desktopbackground $priority
|
|
done << EOF
|
|
lines.xml 20
|
|
joy.xml 10
|
|
EOF
|
|
|
|
# Login theme
|
|
## Lines
|
|
update-alternatives --install /usr/share/images/desktop-base/login-background.svg \
|
|
desktop-login-background \
|
|
/usr/share/desktop-base/lines-theme/login-background.svg 70 \
|
|
--slave /usr/share/sddm/themes/debian-theme/sddm-preview.jpg \
|
|
desktop-sddm-preview \
|
|
/usr/share/desktop-base/lines-theme/sddm-preview.jpg
|
|
update-alternatives --install /usr/share/images/desktop-base/login-background.svg \
|
|
desktop-login-background \
|
|
/usr/share/desktop-base/lines-theme/login-background-with-logo.svg 65 \
|
|
--slave /usr/share/sddm/themes/debian-theme/sddm-preview.jpg \
|
|
desktop-sddm-preview \
|
|
/usr/share/desktop-base/lines-theme/sddm-preview.jpg
|
|
## Joy
|
|
update-alternatives --install /usr/share/images/desktop-base/login-background.svg \
|
|
desktop-login-background \
|
|
/usr/share/desktop-base/joy-theme/login-background.svg 60 \
|
|
--slave /usr/share/sddm/themes/debian-theme/sddm-preview.jpg \
|
|
desktop-sddm-preview \
|
|
/usr/share/desktop-base/joy-theme/sddm-preview.jpg
|
|
|
|
# Alternatives for grub
|
|
## Favor widescreen / hi-res background for efi installations
|
|
num_grub_efi_installed=$(dpkg-query --list "grub-efi*" | grep "^i" | wc -l)
|
|
if [ $num_grub_efi_installed -gt 0 ] ; then
|
|
lines_grub_prio=15
|
|
lines_grub_1920_prio=20
|
|
else
|
|
lines_grub_prio=20
|
|
lines_grub_1920_prio=15
|
|
fi
|
|
update-alternatives --install \
|
|
/usr/share/images/desktop-base/desktop-grub.png \
|
|
desktop-grub \
|
|
/usr/share/images/desktop-base/lines-grub.png $lines_grub_prio
|
|
update-alternatives --install \
|
|
/usr/share/images/desktop-base/desktop-grub.png \
|
|
desktop-grub \
|
|
/usr/share/images/desktop-base/lines-grub-1920x1080.png $lines_grub_1920_prio
|
|
|
|
while read background priority; do
|
|
update-alternatives --install \
|
|
/usr/share/images/desktop-base/desktop-grub.png \
|
|
desktop-grub \
|
|
/usr/share/images/desktop-base/$background $priority
|
|
done << EOF
|
|
joy-grub.png 15
|
|
spacefun-grub.png 15
|
|
spacefun-grub-widescreen.png 14
|
|
EOF
|
|
|
|
# GRUB background
|
|
if which update-grub2 > /dev/null ; then
|
|
# Ensure the background image file has actually been written to disc
|
|
# before updating.
|
|
sync
|
|
update-grub2 || true
|
|
fi
|
|
|
|
which update-initramfs > /dev/null
|
|
if [ $? -eq 0 ] ; then
|
|
update-initramfs -u
|
|
fi
|
|
|
|
fi
|