#!/bin/sh
set -e

BASE=/usr/share/kazamos-desktop-base/kazamos

if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then

    # GRUB background (both ratios)
    for ratio in 16x9 4x3; do
        update-alternatives --remove \
            desktop-grub \
            ${BASE}/grub/grub-${ratio}.png
    done

    # Login background
    update-alternatives --remove \
        desktop-login-background \
        ${BASE}/login/background.svg

    update-alternatives --remove \
        desktop-login-background \
        ${BASE}/login/background-nologo.svg

    # Wallpaper
    for res in 1080x2160 1280x1024 1280x800 1920x1080 1920x1200 2520x1080; do
        update-alternatives --remove \
            desktop-background \
            ${BASE}/wallpaper/contents/images/${res}.svg
    done

    # GRUB theme script
    rm -f /etc/grub.d/05_kazamos_theme

fi
