Path: utzoo!mnetor!uunet!husc6!rutgers!mtune!mtgzz!avr From: avr@mtgzz.UUCP (XMRP50000[jcm]-a.v.reed) Newsgroups: comp.windows.x Subject: How to lock a sun under X Message-ID: <3757@mtgzz.UUCP> Date: 21 Mar 88 18:10:10 GMT Organization: AT&T, Middletown NJ Lines: 67 Keywords: Security Privacy Proprietary X_Window_System Suntools Our company policy on protecting proprietary information requires that all workstations and terminals be locked when left unattended, however briefly. Under suntools, this is readily accomplished with the "Lock Screen" selection in the top-level menu, which calls /usr/bin/lockscreen. Since there is as yet no comparable program under the X Window System, the easiest way to be able to lock the screen under X is to run X 11 (made with -DSUN_WINDOWS) over suntools. I do this automatically by placing alias -x x='XRUN=XRUN;export XRUN;/usr/bin/suntools -s $HOME/.xst;clear' and the clause if [ `tty` = /dev/ttyp0 -a "$WINDOW_PARENT" -a "$XRUN" ] then sleep 16 trap "" 1 15 . $HOME/.xrun 2>/dev/null kill `ps -g|/bin/grep suntools|cut -c1-5` trap 1 15 fi in my ksh $ENV file. When I invoke "x" from the login shell, the alias fires up suntools with the startup script $HOME/.xst, which contains the one line cmdtool -Wp 0 0 -Ws 590 55 -WP 0 0 -Wl "<< CONSOLE >>" -WL console -C The ksh that automatically fires up in cmdtool runs into the "if" clause above, and executes $HOME/.xrun, which contains my X startup (I don't use xinit; and I won't post my opinion of xinit where it might be read by minors :-) : # PATH=:/usr/mtgzfs1/avr/x11r2.core/usr/bin/X11$PATH TTY=`tty` DISPLAY=adam:0;export DISPLAY (sleep 2 ; xterm -fn 6x10 -b 2 -bw 3 =80x24+0-450 -C) 2>/dev/null & (sleep 3 ; xterm -fn 6x10 -b 2 -bw 3 =81x44-0-0) 2>/dev/null & (sleep 4 ; xterm -fn 6x10 -b 2 -bw 3 =81x44-0+0) 2>/dev/null & (sleep 5 ; xterm -fn 6x10 -b 2 -bw 3 =81x44+0-0) 2>/dev/null & (sleep 6 ; xterm -fn 6x10 -b 2 -bw 3 =81x89+573+0) 2>/dev/null & (sleep 7 ; xterm -fn 6x10 -b 2 -bw 3 =81x89-573+0) 2>/dev/null & (sleep 8 ; xclock -analog =83x83+0+0 -update 1) 2>xclock.out & (sleep 9 ; xsetroot -gray) 2>/dev/null & (sleep 12 ; uwm) 2>uwm.out & (sleep 14 ; xset -r m 4 2 s 600 ) 2>/dev/null & Xsun -mono -fp /usr/mtgzfs1/avr/x11r2.core/fonts/snf -a 4 -t 2 \ -co /usr/mtgzfs1/avr/x11r2.core/util/rgb/rgb -r \ >/$HOME/xsun.out 2>&1 case $TTY in /dev/ttyp* ) kbd_mode -e ;; * ) kbd_mode -a setkeys reset ;; esac clear Once in x, I can lock the screen with the alias "xlock", also in my $ENV: alias -x xlock='xset s off;/usr/bin/lockscreen;xrefresh;xset s;kbd_mode -u' And to quit, I just type "xkill": alias -x xkill='kill `ps -g|/bin/grep Xsun|cut -c1-5`' Adam Reed (mtgzz!avr)