#!/bin/bash
# Script name: /lib/systemd/system-sleep/auto-hibernate
# Purpose: Auto hibernates after a period of sleep
# Edit the "autohibernate" variable below to set the number of seconds to sleep.
. /usr/share/acpi-support/power-funcs

if [ "$1" = "pre" ]
then
        if [ "$2" = "hybrid-sleep" ]
        then
	    d=/tmp/.X11-unix
	    for x in $d/X*; do
		displaynum=${x#$d/X}
		getXconsole
		xset dpms force off
	    done
        fi
fi


#if [ "$1" = "post" ]
#then
#        if [ "$2" = "hybrid-sleep" ]
#        then
#		/wakeup
#fi
