post_install() {

if [[ -d "/data/data/com.termux/files/usr/share/applications" ]]; then
    update-desktop-database -q
fi

exit 0
}
post_upgrade() {
post_install
}
pre_remove() {

if [[ "${1}" = "remove" || "pacman" = "pacman" ]]; then
    if [[ -d "/data/data/com.termux/files/usr/share/applications" ]]; then
        rm -f "/data/data/com.termux/files/usr/share/applications/mimeinfo.cache"
        rmdir --ignore-fail-on-non-empty "/data/data/com.termux/files/usr/share/applications"
    fi
fi

exit 0
}
