--- configure.ac.orig 2015-02-28 17:28:11.000000000 +0100 +++ configure.ac 2016-01-02 01:37:51.000000000 +0100 @@ -190,7 +190,8 @@ if test x$with_backend = x; then [*-linux*], [with_backend=linux], [*-*freebsd*], [with_backend=freebsd], [*-*dragonfly*], [with_backend=freebsd], - [*-openbsd*], [with_backend=openbsd]) + [*-openbsd*], [with_backend=openbsd], + [*-darwin*], [with_backend=darwin]) fi AC_DEFINE_UNQUOTED(BACKEND, "$with_backend", [backend]) AC_SUBST(BACKEND, "$with_backend") @@ -204,6 +205,9 @@ fi if test x$with_backend = xopenbsd; then AC_DEFINE(BACKEND_TYPE_OPENBSD, 1, [OpenBSD suspend/hibernate backend]) fi +if test x$with_backend = xdarwin; then + AC_DEFINE(BACKEND_TYPE_DARWIN, 1, [Darwin suspend/hibernate backend]) +fi dnl check for location Xfce glade files were installed to XFCE_GLADE_CATALOG_PATH="`pkg-config --variable glade_catalogdir libxfce4ui-1`" --- xfce4-session/xfsm-shutdown-fallback.c.orig 2015-02-28 17:28:00.000000000 +0100 +++ xfce4-session/xfsm-shutdown-fallback.c 2016-01-02 01:09:29.000000000 +0100 @@ -291,6 +291,9 @@ xfsm_shutdown_fallback_can_suspend (void #ifdef BACKEND_TYPE_OPENBSD return TRUE; #endif +#ifdef BACKEND_TYPE_DARWIN + return TRUE; +#endif return FALSE; } --- xfsm-shutdown-helper/main.c.orig 2016-01-02 01:09:14.000000000 +0100 +++ xfsm-shutdown-helper/main.c 2016-01-02 01:28:03.000000000 +0100 @@ -91,6 +91,10 @@ #define UP_BACKEND_SUSPEND_COMMAND "/usr/sbin/zzz" #define UP_BACKEND_HIBERNATE_COMMAND "/usr/sbin/ZZZ" #endif +#ifdef BACKEND_TYPE_DARWIN +#define UP_BACKEND_SUSPEND_COMMAND "/usr/bin/pmset sleepnow" /* hibernatemode 0 */ +#define UP_BACKEND_HIBERNATE_COMMAND "/usr/bin/pmset sleepnow" /* hibernatemode 3 */ +#endif static gboolean