I've been struggling to get X to lock by calling xlock(1) from /etc/apm/{hibernate,resume,standby,suspend}
Haven't seen a lot of useful debug output from xlock... # xlock -verbose ; echo $? 1 # xlock -verbose -display :0.0 ; echo $? No protocol specified 1 # I've figured out an effective workaround I think, which is to SIGUSR1 my running xidle(1) process, which works. I'm just wondering if there's a better way to get apmd, running /etc/apm/* as root, to do the same. I tried calling xlock both as root and as the current X user, no noticeable difference in results.