THEME=manjariando-white

post_install() {
    sed -i 's| \bbootsplash-[[:alnum:]+_-]*\b||' /etc/mkinitcpio.conf
    bootsplash-manager --set $THEME
}

pre_remove() {
    if [ "$(cat /etc/mkinitcpio.conf | grep '^HOOKS' | sed 's/HOOKS="//; s/"/ /; s/ /\n/g' | grep "bootsplash-")" = "bootsplash-$THEME" ]; then
        bootsplash-manager --disable
        sed -i 's| \bbootsplash-[[:alnum:]+_-]*\b||' /etc/mkinitcpio.conf
        mkinitcpio -P
    fi
}
