#!/bin/sh
set -e

# Varsayılan görüntü izleyici olarak ayarla
for mime in image/png image/jpeg image/jpg image/webp image/bmp image/gif; do
  xdg-mime default imajviewer.desktop "$mime" 2>/dev/null || true
done

# Masaüstü veritabanını güncelle
which update-desktop-database >/dev/null 2>&1 && \
  update-desktop-database /usr/share/applications/ 2>/dev/null || true
which gtk-update-icon-cache >/dev/null 2>&1 && \
  gtk-update-icon-cache /usr/share/icons/hicolor/ 2>/dev/null || true
which update-mime-database >/dev/null 2>&1 && \
  update-mime-database /usr/share/mime >/dev/null 2>&1 || true

exit 0
