#!/bin/sh
set -e

RUNTIME="/usr/lib/focus-guard/runtime-python3"

case "$1" in
  remove|purge)
    if command -v setcap >/dev/null 2>&1 && [ -e "$RUNTIME" ]; then
      setcap -r "$RUNTIME" 2>/dev/null || true
    fi
    rm -f "$RUNTIME"
    if command -v update-desktop-database >/dev/null 2>&1; then
      update-desktop-database -q /usr/share/applications || true
    fi
    if command -v gtk-update-icon-cache >/dev/null 2>&1; then
      gtk-update-icon-cache -f -t /usr/share/icons/hicolor >/dev/null 2>&1 || true
    fi
    ;;
esac

#DEBHELPER#

exit 0
