#!/bin/sh
set -e

#DEBHELPER#

if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
    update-alternatives --remove vendor-logos /usr/share/desktop-base/os-logos || true
    update-alternatives --remove desktop-theme /usr/share/desktop-base/vesperos-theme || true
fi

if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
    # Reset Plymouth theme only if vesperos is still active
    if command -v plymouth-set-default-theme > /dev/null 2>&1; then
        if [ "$(plymouth-set-default-theme)" = "vesperos" ]; then
            plymouth-set-default-theme -R text
        fi
    fi
fi
