#!/usr/bin/env bash

# path
DIR=$(readlink -f "$0") #resolve symlink
ROOT=$(dirname "$DIR") #obtain dir of the resolved path
LINUX="$ROOT/pharo-vm"
RESOURCES="$ROOT/shared"
ICONS="$ROOT/icons"

# icon (note: gvfs-set-attribute is found in gvfs-bin on Ubuntu
# systems and it seems to require an absolute filename)
gvfs-set-attribute \
	"$0" \
	"metadata::custom-icon" \
	"file://$ICONS/pharo-launcher.png" \
		2> /dev/null

image="$RESOURCES/PharoLauncher.image"
 
# execute
exec "$LINUX/pharo" "$image"
