
. /usr/share/acpi-support/power-funcs

# The (not very aptly named) function CheckPolicy checks if the current X
# console user is running a power management daemon that handles suspend/resume
# requests. This is used in various places to determine if we need to handle
# something ourselves or if we need to pass the info on to a power management
# daemon (e.g. through a fake key press).
CheckPolicy() {
	getXconsole
	if pidof gnome-power-manager kpowersave > /dev/null ||
	   ( test "$XUSER" != "" && pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop --user $XUSER kded kded loadedModules | grep -q klaptopdaemon) ; then
		echo 0;
	else
		echo 1;
	fi
}
