#!/bin/bash

# I don't know how reliable this is.  If you have a better solution for
# checking if X is running (and for arguments), please drop me a line at
# x.seeks@gmail.com


if [ $# != "1" ]; then
  if [ ! -s $DISPLAY ]
    then sh /usr/local/bin/pyimgsort-gui
else
  sh /usr/local/bin/pyimgsort-cli "$@"
  fi
  else sh /usr/local/bin/pyimgsort-cli "$@"
  exit 0
fi
