#!/bin/sh

# This is a simple script to check if the om engine is running or not.
# If the engine is running, it proceeds to start om_gtk GUI.
# If the engine is not running, it will start it up and then proceed
# with launching the om_gtk GUI.


function is_om_running() {
	ps aux | grep "om$" | grep -v grep
}

if ! is_om_running ; then
	`which om` &
	sleep 2
fi

if ! is_om_running ; then
	zenity --info --title "Error" --text "Om could not be launched. Do you have JACK running?"
else
	`which om_gtk` &
fi
