#!/bin/bash

WINGHOME="`dirname "$0"`/../../.."

case "$1" in
    --install)
        MODE=install
        ;;
    --uninstall)
        MODE=uninstall
        ;;
    *)
        echo "$0 [--help|--install|--uninstall]"
        echo ""
        exit 1
        ;;
esac

for size in 16 32 48 64 128
do
    xdg-icon-resource $MODE --novendor --noupdate --size $size $WINGHOME/resources/wing$size.png ~~PRODUCT_SPEC_VERSION~~
done
xdg-icon-resource forceupdate

xdg-desktop-menu $MODE --novendor $WINGHOME/resources/linux/desktop/~~PRODUCT_SPEC_VERSION~~.desktop
xdg-mime $MODE --novendor $WINGHOME/resources/linux/desktop/~~PRODUCT_SPEC_VERSION~~.xml
