[ltp] gnome-screensaver and locking using fn-f2
Jerome Poggi
linux-thinkpad@linux-thinkpad.org
Wed, 4 Apr 2007 14:04:29 +0200
On Wed, 04 Apr 2007, Grant Williamson wrote:
> That does not seem to work either, xscreensaver would, even if I set
> XAUTH & DISPLAY.
>
I use this ugly script :-)
MY_LOGON="poggi"
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
su - ${MY_LOGON} -c "<<YOUR COMMAND>>"
Sincerly,
Jérôme Poggi
--
Jerome POGGI Jerome.Poggi@hsc.fr
Herve Schauer Consultants -=- Network security consultant, CISSP
http://www.hsc.fr/ Tel : +33 141 409 700