#!/bin/bash

# If gnome-session is going to start compiz,
# we don't want to be the ones doing it.
if grep -q compiz /usr/share/gnome-session/sessions/ubuntu.session ; then
  echo "GNOME Session is starting Compiz"
  stop
  exit 1
fi

if (systemctl --user is-active unity7 &> /dev/null); then
  echo "Unity instance is managed by Systemd, ignoring request..."
  stop
  exit 1
fi

exit 0
