#!/bin/bash

#©keithhedger Mon 10 Oct 11:14:09 BST 2016 kdhedger68713@gmail.com

KKEDIT=../../app/kkedit
KKMSG=../../app/kkeditmsg
INSTANCE=$(xdotool get_desktop)

#if arg then remove and flush q then exit
if [ "X$1" != "X" ];then
	$KKMSG -k $INSTANCE -fR
	exit 0
fi
#make sure queue is empty
$KKMSG -k $INSTANCE -f

#open instance or bring to front
($KKEDIT -i $INSTANCE) &

$KKMSG -k $INSTANCE -s "RestoreSession:${HOME}/.KKEdit/plugins-gtk/session-0" -a
sleep 1
$KKMSG -k $INSTANCE -s "SelectTab:ChangeLog" -a
$KKMSG -k $INSTANCE -s "RunTool:Open Folder And Terminal" -a

exit 0
