#!/bin/bash
# GMM (C) 2018 Stephane Charette <stephanecharette@gmail.com>
# $Id: postinst 2327 2017-08-15 21:29:41Z stephane $


echo "Postinst: $@"


if [ -x "$(which xdg-icon-resource)" ]; then
	xdg-icon-resource install --context apps --mode system --size 256 /usr/doc/GMM/gmm_logo_256.png GMM-Logo
	xdg-icon-resource install --context apps --mode system --size 128 /usr/doc/GMM/gmm_logo_128.png GMM-Logo
	xdg-icon-resource install --context apps --mode system --size 64  /usr/doc/GMM/gmm_logo_064.png GMM-Logo
	xdg-icon-resource install --context apps --mode system --size 48  /usr/doc/GMM/gmm_logo_048.png GMM-Logo
	xdg-icon-resource install --context apps --mode system --size 32  /usr/doc/GMM/gmm_logo_032.png GMM-Logo
	xdg-icon-resource install --context apps --mode system --size 22  /usr/doc/GMM/gmm_logo_022.png GMM-Logo
	xdg-icon-resource install --context apps --mode system --size 16  /usr/doc/GMM/gmm_logo_016.png GMM-Logo
fi

if [ -x "$(which xdg-desktop-menu)" ]; then
	xdg-desktop-menu install --mode system /usr/doc/GMM/ccoderun-gmm.desktop
fi

if [ -x "$(which xdg-desktop-icon)" ]; then
	if [ "$SUDO_USER" != "" ]; then
		sudo -u $SUDO_USER xdg-desktop-icon install /usr/doc/GMM/ccoderun-gmm.desktop
	fi
fi


touch /var/log/gmm.log
chmod a+w /var/log/gmm.log


exit 0
