#!/bin/sh

DOTDESKTOP="/usr/share/applications/tas.desktop"
ICON_LEGACY="/usr/local/lib/X11/mini-icons/mini-camera.xpm"
ICON_MODERN="/usr/share/pixmaps/puppy/photocamera.svg"

if [ "`pwd`" != "/" ]; then	# woof
  DOTDESKTOP=".${DOTDESKTOP}"
  [ -f ".${ICON_MODERN}" ] && ICON="Icon=${ICON_MODERN}" || ICON="Icon=${ICON_LEGACY}"
else
  [ -f "${ICON_MODERN}" ] && ICON="Icon=${ICON_MODERN}" || ICON="Icon=${ICON_LEGACY}"
fi

sed -i "s#^Icon=.*#$ICON#" "$DOTDESKTOP"
