#!/bin/bash # Try to find the .Xauthority file used to start the X server # (based on an idea by David Schweikert <dws@ee.eth.ch>) PID=`pidof /usr/X11R6/bin/X` AUTH=`perl -ne'/\x00-auth\x00(.*?)\x00.*/&&print$1' /proc/$PID/cmdline` if [ x"$AUTH" = x ]; then AUTH=`perl -ne'/(^|\x00)XAUTHORITY=(.*?)\x00/&&print$2' /proc/$PID/environ` fi export XAUTHORITY=$AUTH /usr/X11R6/bin/xset -display :0 dpms force standby