function post_install() {
#!/bin/sh
# After installing or upgrading an AEShot package: refresh the desktop's menu database and the
# icon cache where the tools are installed. Never fails (the package works without them, and the
# distributions' own triggers usually do this too).
if command -v update-desktop-database >/dev/null 2>&1; then
  update-desktop-database -q /usr/share/applications >/dev/null 2>&1 || true
fi
if command -v gtk-update-icon-cache >/dev/null 2>&1 && [ -f /usr/share/icons/hicolor/index.theme ]; then
  gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor >/dev/null 2>&1 || true
fi
# Breeze Dark (the dark icon): only a cache that is there already, so none is made for a theme the
# system does not have.
if command -v gtk-update-icon-cache >/dev/null 2>&1 && [ -f /usr/share/icons/breeze-dark/index.theme ] \
   && [ -f /usr/share/icons/breeze-dark/icon-theme.cache ]; then
  gtk-update-icon-cache -q -f /usr/share/icons/breeze-dark >/dev/null 2>&1 || true
fi
exit 0

}

function post_remove() {
#!/bin/sh
# After removing an AEShot package: refresh the desktop's menu database and the
# icon cache where the tools are installed. Never fails (the package works without them, and the
# distributions' own triggers usually do this too).
if command -v update-desktop-database >/dev/null 2>&1; then
  update-desktop-database -q /usr/share/applications >/dev/null 2>&1 || true
fi
if command -v gtk-update-icon-cache >/dev/null 2>&1 && [ -f /usr/share/icons/hicolor/index.theme ]; then
  gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor >/dev/null 2>&1 || true
fi
# Breeze Dark (the dark icon): only a cache that is there already, so none is made for a theme the
# system does not have.
if command -v gtk-update-icon-cache >/dev/null 2>&1 && [ -f /usr/share/icons/breeze-dark/index.theme ] \
   && [ -f /usr/share/icons/breeze-dark/icon-theme.cache ]; then
  gtk-update-icon-cache -q -f /usr/share/icons/breeze-dark >/dev/null 2>&1 || true
fi
exit 0

}

