#!/bin/bash

app_name=""
app_icon=""
summary=""
msg=""
image=""
usage="This is just a workaround -- real client will be in next release\!\n"
usage=$usage"Usage: $0 [-a app_name] [-i app_icon] [-s summary] [-m msg] [-g image] [-c config]\n"

if(($#<1)); then
    echo -e $usage
    exit 1
fi

while getopts ":a:i:s:m:g:c:" options; do
  case $options in
    a ) app_name=$OPTARG;;
    i ) app_icon=$OPTARG;;
    s ) summary=$OPTARG;;
    m ) msg=$OPTARG;;
    g ) image=$OPTARG;;
    c ) dbus-send --dest="org.freedesktop.Notifications" --print-reply --type=method_call /org/freedesktop/Notifications \
	 org.freedesktop.Notifications.SetServerConfig string:"[InfoBoxDaemon]
	 $OPTARG"
	exit;;
    h ) echo -e $usage
	exit 1;;
    ? ) echo -e $usage
	exit 1;;
    * ) echo -e $usage
	exit 1;;
  esac
done

dbus-send --dest="org.freedesktop.Notifications" --print-reply --type=method_call /org/freedesktop/Notifications \
 org.freedesktop.Notifications.ShortNotify string:"$app_name" string:"$app_icon" string:"$summary" string:"$msg" string:"$image"
