#!/home/d4/cp/d4x
# d4 script for running in user's directories
# aliases are taken from the local d4s.lst

LOCAL;DSH;REPEAT MAIN_MNU;QUIT

Z<-LOCAL
|Add user specific stuff here
D4LIB_PATH<-"/home/d4/cp/" #ifndef "D4LIB_PATH"
XRESIZE
0 r #cmd"setterm -blank 0"
0 r #copy"test.afn"
STARTUP"SET_TTY"
D4.P<-"$ "
Z<-ADD_ALIAS LOCAL.LST

"LOCAL.LST"
myhost|#cmd"<echo $HOSTNAME"
myhome|#cmd"<echo $HOME"

Z<-XRESIZE;SANE;K
|Extract digits from resize command
SANE<-24 80
Z<-#sstomat #cmd"< stty -a"
Z<-#sstomat ";",Z[0]
K<-(c/y "rows" #find Z)/:Z
->(0=rK)/A1
SANE[0]<-#fi (K e "0123456789")/K
A1:K<-(c/y "columns" #find Z)/:Z
->(0=rK)/SET
SANE[1]<-#fi (K e "0123456789")/K
SET:Z<- #screen SANE
Z<-0 r #cursor 0 0
