#!/bin/bash

. /usr/lib/pm-utils/functions

suspend_qc() {
  # Tell QuteCom that the system shuts down
  #dbus-send --system                       \
  #  --print-reply --reply-timeout=200      \
  #  --dest=org.qutecom                     \
  #  /                                      \
  #  org.qutecom.Wakeup.wakeup
  true
}

resume_qc() {
  # Wake up QuteCom and make it do a new connection
  dbus-send --system                       \
    /                                      \
    org.qutecom.Wakeup.wakeup
}

case "$1" in
  hibernate|suspend)
    suspend_qc
  ;;
  thaw|resume)
    resume_qc
  ;;
  *)
  ;;
esac

exit $?
