A patch to xterm/misc.c to add escape sequences to report DISPLAY and/or hostname. Includes the utilities xtattr for changing xterm attributes via escape sequences, and xdisplay which queries xterm and spits out DISPLAY or hostname. #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'README' <<'END_OF_FILE' XThis is a patch for xterm, and a couple of useful utilities that adds Xtwo new escape sequences to xterm, and provides utilities to deal with Xthem and other xterm escape sequences. X XThe two new escape sequences provide a way to query xterm for DISPLAY Xand hostname (via gethostname()) which can be very useful when using Xrlogin or telnet to get to other machines. There is a note in the Xxterm source wondering if this kind of thing might be a security Xhole, but I don't think so, and a previous query didn't yield anyone Xelse who thought so. The change to xterm is a straightforward patch Xto mit/clients/xterm/misc.c, applied after MIT fix #6, but it should Xbe obvious where it goes in any case. X XThe utility programs are xdisplay, which is a rip-off of some of the Xresize code, and which spits out DISPLAY or hostname after querying Xyour xterm; and xtattr, which spits out xterm escape sequences to Xchange various xterm attributes. X XNaturally, no warranties, bug fixes and enhancements accepted, but Xno support committments. Available via anonymous ftp from Xwatmath.waterloo.edu in pub/x11/xterm.escapes, and quite possibly Xfrom expo.lcs.mit.edu in contrib/xterm.escapes. X XJohn Sellens XMath Faculty Computing Facility XUniversity of Waterloo Xjmsellens@watmath.waterloo.edu END_OF_FILE if test 1275 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'misc.c.patch' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'misc.c.patch'\" else echo shar: Extracting \"'misc.c.patch'\" \(1455 characters\) sed "s/^X//" >'misc.c.patch' <<'END_OF_FILE' X*** /tmp/,RCSt1024171 Sun Dec 30 01:19:03 1990 X--- mit/clients/xterm/misc.c Sat Dec 29 23:42:03 1990 X*************** X*** 32,37 **** X--- 32,38 ---- X X #include X #include X+ #include X #include X #include X #include X*************** X*** 596,601 **** X--- 597,638 ---- X * One could write code to send back the display and host names, X * but that could potentially open a fairly nasty security hole. X */ X+ case 51: /* echo DISPLAY variable to file 'buf' */ X+ { X+ int fd; X+ if ( !buf || !*buf ) /* no file given */ X+ fd = screen->respond; X+ else X+ fd = open( buf, O_WRONLY|O_CREAT, 0666 ); X+ if ( fd >= 0 ) { X+ char *p = DisplayString( screen->display ); X+ if ( ! p ) X+ p = ""; X+ write( fd, p, strlen( p ) ); X+ write( fd, "\n", 1 ); X+ if ( fd != screen->respond ) X+ (void) close( fd ); X+ } X+ } X+ break; X+ case 52: /* echo hostname to file 'buf' */ X+ { X+ int fd; X+ if ( !buf || !*buf ) /* no file given */ X+ fd = screen->respond; X+ else X+ fd = open( buf, O_WRONLY|O_CREAT, 0666 ); X+ if ( fd >= 0 ) { X+ char hname[MAXHOSTNAMELEN+1]; X+ if ( gethostname( hname, sizeof(hname) ) != 0 ) X+ strcpy( hname, "unknown" ); X+ write( fd, hname, strlen( hname ) ); X+ write( fd, "\n", 1 ); X+ if ( fd != screen->respond ) X+ (void) close( fd ); X+ } X+ } X+ break; X } X } X END_OF_FILE if test 1455 -ne `wc -c <'misc.c.patch'`; then echo shar: \"'misc.c.patch'\" unpacked with wrong size! fi # end of 'misc.c.patch' fi if test ! -d 'xdisplay' ; then echo shar: Creating directory \"'xdisplay'\" mkdir 'xdisplay' fi if test -f 'xdisplay/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xdisplay/Imakefile'\" else echo shar: Extracting \"'xdisplay/Imakefile'\" \(30 characters\) sed "s/^X//" >'xdisplay/Imakefile' <<'END_OF_FILE' XSimpleProgramTarget(xdisplay) END_OF_FILE if test 30 -ne `wc -c <'xdisplay/Imakefile'`; then echo shar: \"'xdisplay/Imakefile'\" unpacked with wrong size! fi # end of 'xdisplay/Imakefile' fi if test -f 'xdisplay/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xdisplay/Makefile'\" else echo shar: Extracting \"'xdisplay/Makefile'\" \(8662 characters\) sed "s/^X//" >'xdisplay/Makefile' <<'END_OF_FILE' X# Makefile generated by imake - do not edit! X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $ X X########################################################################### X# Makefile generated from "Imake.tmpl" and X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $ X# X# Platform-specific parameters may be set in the appropriate .cf X# configuration files. Site-wide parameters may be set in the file X# site.def. Full rebuilds are recommended if any parameters are changed. X# X# If your C preprocessor doesn't define any unique symbols, you'll need X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing X# "make Makefile", "make Makefiles", or "make World"). X# X# If you absolutely can't get imake to work, you'll need to set the X# variables at the top of each Makefile as well as the dependencies at the X# bottom (makedepend will do this automatically). X# X X########################################################################### X# platform-specific configuration parameters - edit mips.cf to change X X# platform: Waterloo: mips.cf X# operating system: Umips X X########################################################################### X# site-specific configuration parameters - edit site.def to change X X# site: $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $ X X# site: Waterloo site.def X X SHELL = /bin/sh X X TOP = . X CURRENT_DIR = . X X AR = ar cq X BOOTSTRAPCFLAGS = X CC = cc X X COMPRESS = compress X CPP = /lib/cpp $(STD_CPP_DEFINES) X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES) X INSTALL = install X LD = ld X LINT = lint X LINTLIBFLAG = -C X LINTOPTS = -axz X LN = ln -s X MAKE = make X MV = mv X CP = cp X RANLIB = ranlib X RANLIBINSTFLAGS = X RM = rm -f X STD_INCLUDES = X STD_CPP_DEFINES = X STD_DEFINES = -Dumips X EXTRA_LOAD_FLAGS = X EXTRA_LIBRARIES = -lcfix X TAGS = ctags X X SIGNAL_DEFINES = -DSIGNALRETURNSINT X X PROTO_DEFINES = X X INSTPGMFLAGS = -s X X INSTBINFLAGS = -m 0755 X INSTUIDFLAGS = -m 4755 X INSTLIBFLAGS = -m 0664 X INSTINCFLAGS = -m 0444 X INSTMANFLAGS = -m 0444 X INSTDATFLAGS = -m 0444 X INSTKMEMFLAGS = -g kmem -m 2755 X X DESTDIR = X X TOP_INCLUDES = -I$(INCROOT) X X CDEBUGFLAGS = -O X CCOPTIONS = -Wf,-XNp6000,-XNd4000 X COMPATFLAGS = X X ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES) X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS) X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) X LDCOMBINEFLAGS = -X -r X X MACROFILE = mips.cf X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut X X IMAKE_DEFINES = X X IRULESRC = $(CONFIGDIR) X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES) X X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \ X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \ X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES) X X########################################################################### X# X Window System Build Parameters X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $ X X########################################################################### X# X Window System make variables; this need to be coordinated with rules X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $ X X PATHSEP = / X USRLIBDIR = $(DESTDIR)/software/x11,dev/lib X SHAREDUSRLIBDIR = $(DESTDIR)/software/x11,sun/lib X BINDIR = $(DESTDIR)/software/x11/bin X DEVBINDIR = $(DESTDIR)/software/x11,dev/bin X INCROOT = $(DESTDIR)/software/x11,dev/include X BUILDINCROOT = $(TOP) X BUILDINCDIR = $(BUILDINCROOT)/X11 X BUILDINCTOP = .. X INCDIR = $(INCROOT)/X11 X ADMDIR = $(DESTDIR)/software/x11/logs X LIBDIR = $(DESTDIR)/software/x11/data X CONFIGDIR = /software/x11,dev/data/config X LINTLIBDIR = $(USRLIBDIR)/lint X X FONTDIR = /software/font/data/x11/other X XINITDIR = $(LIBDIR)/xinit X XDMDIR = $(LIBDIR)/xdm X AWMDIR = $(LIBDIR)/awm X TWMDIR = $(LIBDIR)/twm X GWMDIR = $(LIBDIR)/gwm X MANPATH = $(DESTDIR)$(DESTDIR)/software/x11/man X MANSOURCEPATH = $(MANPATH)/man X MANDIR = $(MANSOURCEPATH)1 X LIBMANDIR = $(MANSOURCEPATH)3 X XAPPLOADDIR = /software/x11,minimal/data/app-defaults X X FONTCFLAGS = -t X X INSTAPPFLAGS = $(INSTDATFLAGS) X X IMAKE = imake X DEPEND = makedepend X RGB = rgb X FONTC = bdftosnf X MKFONTDIR = mkfontdir X MKDIRHIER = /bin/sh $(DEVBINDIR)/mkdirhier X X CONFIGSRC = $(TOP)/config X CLIENTSRC = $(TOP)/clients X DEMOSRC = $(TOP)/demos X LIBSRC = $(TOP)/lib X FONTSRC = $(TOP)/fonts X INCLUDESRC = $(TOP)/X11 X SERVERSRC = $(TOP)/server X UTILSRC = $(TOP)/util X SCRIPTSRC = $(UTILSRC)/scripts X EXAMPLESRC = $(TOP)/examples X CONTRIBSRC = $(TOP)/../contrib X DOCSRC = $(TOP)/doc X RGBSRC = $(TOP)/rgb X DEPENDSRC = $(UTILSRC)/makedepend X IMAKESRC = $(CONFIGSRC) X XAUTHSRC = $(LIBSRC)/Xau X XLIBSRC = $(LIBSRC)/X X XMUSRC = $(LIBSRC)/Xmu X TOOLKITSRC = $(LIBSRC)/Xt X AWIDGETSRC = $(LIBSRC)/Xaw X OLDXLIBSRC = $(LIBSRC)/oldX X XDMCPLIBSRC = $(LIBSRC)/Xdmcp X BDFTOSNFSRC = $(FONTSRC)/bdftosnf X MKFONTDIRSRC = $(FONTSRC)/mkfontdir X EXTENSIONSRC = $(TOP)/extensions X X DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a X EXTENSIONLIB = $(DEPEXTENSIONLIB) X X DEPXLIB = $(DEPEXTENSIONLIB) $(USRLIBDIR)/libX11.a X XLIB = $(EXTENSIONLIB) $(USRLIBDIR)/libX11.a X X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a X XAUTHLIB = $(DEPXAUTHLIB) X X DEPXMULIB = $(USRLIBDIR)/libXmu.a X XMULIB = $(DEPXMULIB) X X DEPOLDXLIB = $(USRLIBDIR)/liboldX.a X OLDXLIB = $(DEPOLDXLIB) X X DEPXTOOLLIB = $(USRLIBDIR)/libXt.a X XTOOLLIB = $(DEPXTOOLLIB) X X DEPXAWLIB = $(USRLIBDIR)/libXaw.a X XAWLIB = $(DEPXAWLIB) X X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln X LINTXLIB = $(USRLIBDIR)/llib-lX11.ln X LINTXMU = $(USRLIBDIR)/llib-lXmu.ln X LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln X LINTXAW = $(USRLIBDIR)/llib-lXaw.ln X X DEPLIBS = $(LOCAL_LIBRARIES) X X DEPLIBS1 = $(DEPLIBS) X DEPLIBS2 = $(DEPLIBS) X DEPLIBS3 = $(DEPLIBS) X X########################################################################### X# Imake rules for building libraries, programs, scripts, and data files X# rules: $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $ X X########################################################################### X# start of Imakefile X X OBJS = xdisplay.o X SRCS = xdisplay.c X X PROGRAM = xdisplay X Xall:: xdisplay X Xxdisplay: $(OBJS) $(DEPLIBS) X $(RM) $@ X $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) X Xinstall:: xdisplay X $(INSTALL) -c $(INSTPGMFLAGS) xdisplay $(BINDIR) X Xinstall.man:: xdisplay.man X $(INSTALL) -c $(INSTMANFLAGS) xdisplay.man $(MANDIR)/xdisplay.1 X Xdepend:: X $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS) X Xlint: X $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS) Xlint1: X $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS) X Xclean:: X $(RM) $(PROGRAM) X X########################################################################### X# common rules for all Makefiles - do not edit X Xemptyrule:: X Xclean:: X $(RM_CMD) \#* X XMakefile:: X -@if [ -f Makefile ]; then \ X echo " $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \ X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \ X else exit 0; fi X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) X Xtags:: X $(TAGS) -w *.[ch] X $(TAGS) -xw *.[ch] > TAGS X X########################################################################### X# empty rules for directories that do not have SUBDIRS - do not edit X Xinstall:: X @echo "install in $(CURRENT_DIR) done" X Xinstall.man:: X @echo "install.man in $(CURRENT_DIR) done" X XMakefiles:: X Xincludes:: X X########################################################################### X# dependencies generated by makedepend X END_OF_FILE if test 8662 -ne `wc -c <'xdisplay/Makefile'`; then echo shar: \"'xdisplay/Makefile'\" unpacked with wrong size! fi # end of 'xdisplay/Makefile' fi if test -f 'xdisplay/xdisplay.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xdisplay/xdisplay.c'\" else echo shar: Extracting \"'xdisplay/xdisplay.c'\" \(5382 characters\) sed "s/^X//" >'xdisplay/xdisplay.c' <<'END_OF_FILE' X/* X * xdisplay - based on resize X * John Sellens X * Math Faculty Computing Facility X * University of Waterloo X * jmsellens@watmath.waterloo.edu X */ X X#include X X/* X * Portions derived from resize.c are X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of Digital Equipment X * Corporation not be used in advertising or publicity pertaining to X * distribution of the software without specific, written prior permission. X * X * X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X */ X X X/* xdisplay.c */ X X#include X#include X#include X#include X X#ifdef att X#include X#include X#endif X X#ifdef APOLLO_SR9 X#define CANT_OPEN_DEV_TTY X#endif X X#ifdef macII X#define USE_SYSV_TERMIO X#undef SYSV /* pretend to be bsd */ X#endif /* macII */ X X#ifdef SYSV X#define USE_SYSV_TERMIO X#define USE_SYSV_UTMP X#else /* else not SYSV */ X#define USE_TERMCAP X#endif /* SYSV */ X X#ifdef USE_SYSV_TERMIO X#include X#else /* else not USE_SYSV_TERMIO */ X#include X#endif /* USE_SYSV_TERMIO */ X X#include X X#ifdef USE_SYSV_TERMIO X#define bzero(s, n) memset(s, 0, n) X#endif /* USE_SYSV_TERMIO */ X X X#define TIMEOUT 10 X Xstatic char *myname; X Xstatic int wantdisplay = 0; Xstatic int wanthostname = 0; X#define GETDISPLAY "\033]51;\007" X#define GETHOSTNAME "\033]52;\007" X X#ifdef USE_SYSV_TERMIO Xstruct termio tioorig; X#else /* not USE_SYSV_TERMIO */ Xstruct sgttyb sgorig; X#endif /* USE_SYSV_TERMIO */ X Xint tty; XFILE *ttyfp; X Xchar *rindex(); X Xmain (argc, argv) Xchar **argv; X{ X register char *ptr; X int i; X int arg; X#ifdef USE_SYSV_TERMIO X struct termio tio; X#else /* not USE_SYSV_TERMIO */ X struct sgttyb sg; X#endif /* USE_SYSV_TERMIO */ X char buf[BUFSIZ]; X int onintr(); X char *name_of_tty; X#ifdef CANT_OPEN_DEV_TTY X extern char *ttyname(); X#endif X X if(ptr = rindex(myname = argv[0], '/')) X myname = ptr + 1; X for ( arg=1; arg'xdisplay/xdisplay.man' <<'END_OF_FILE' X.TH XDISPLAY 1 UofW X.SH NAME Xxdisplay \- ask xterm what DISPLAY or hostname it is using X.SH SYNOPSIS X.B xdisplay X.RI [ -d ] X.RI [ -h ] X.SH DESCRIPTION X.I Xdisplay Xuses an escape sequence to query an X.IR xterm (1) Xfor the DISPLAY the xterm is connected to. XThe value is returned from xterm as if it was typed as keyboard input Xto the shell. X.PP XThe X.I -h Xoption causes it to ask for the hostname of the machine that the xterm Xis running on. X.PP X.I -d Xis the default. Only one of X.I -d Xand X.I -h Xmay be used. X.SH EXAMPLES Xcsh: setenv DISPLAY `xdisplay` X.br Xsh: DISPLAY=`xdisplay` X.SH NOTE XMost of the code was stolen from resize(1). X.SH "SEE ALSO" Xxterm(1), xtattr(1) X.SH BUGS XRequires Waterloo added escape sequences for xterm. X.br XEats typeahead, the same way that resize does. X.SH "AUTHOR" X.nf XJohn Sellens XMath Faculty Computing Facility XUniversity of Waterloo Xjmsellens@watmath.waterloo.edu X.fi END_OF_FILE if test 899 -ne `wc -c <'xdisplay/xdisplay.man'`; then echo shar: \"'xdisplay/xdisplay.man'\" unpacked with wrong size! fi # end of 'xdisplay/xdisplay.man' fi if test ! -d 'xtattr' ; then echo shar: Creating directory \"'xtattr'\" mkdir 'xtattr' fi if test -f 'xtattr/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xtattr/Imakefile'\" else echo shar: Extracting \"'xtattr/Imakefile'\" \(28 characters\) sed "s/^X//" >'xtattr/Imakefile' <<'END_OF_FILE' XSimpleProgramTarget(xtattr) END_OF_FILE if test 28 -ne `wc -c <'xtattr/Imakefile'`; then echo shar: \"'xtattr/Imakefile'\" unpacked with wrong size! fi # end of 'xtattr/Imakefile' fi if test -f 'xtattr/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xtattr/Makefile'\" else echo shar: Extracting \"'xtattr/Makefile'\" \(8642 characters\) sed "s/^X//" >'xtattr/Makefile' <<'END_OF_FILE' X# Makefile generated by imake - do not edit! X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $ X X########################################################################### X# Makefile generated from "Imake.tmpl" and X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $ X# X# Platform-specific parameters may be set in the appropriate .cf X# configuration files. Site-wide parameters may be set in the file X# site.def. Full rebuilds are recommended if any parameters are changed. X# X# If your C preprocessor doesn't define any unique symbols, you'll need X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing X# "make Makefile", "make Makefiles", or "make World"). X# X# If you absolutely can't get imake to work, you'll need to set the X# variables at the top of each Makefile as well as the dependencies at the X# bottom (makedepend will do this automatically). X# X X########################################################################### X# platform-specific configuration parameters - edit mips.cf to change X X# platform: Waterloo: mips.cf X# operating system: Umips X X########################################################################### X# site-specific configuration parameters - edit site.def to change X X# site: $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $ X X# site: Waterloo site.def X X SHELL = /bin/sh X X TOP = . X CURRENT_DIR = . X X AR = ar cq X BOOTSTRAPCFLAGS = X CC = cc X X COMPRESS = compress X CPP = /lib/cpp $(STD_CPP_DEFINES) X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES) X INSTALL = install X LD = ld X LINT = lint X LINTLIBFLAG = -C X LINTOPTS = -axz X LN = ln -s X MAKE = make X MV = mv X CP = cp X RANLIB = ranlib X RANLIBINSTFLAGS = X RM = rm -f X STD_INCLUDES = X STD_CPP_DEFINES = X STD_DEFINES = -Dumips X EXTRA_LOAD_FLAGS = X EXTRA_LIBRARIES = -lcfix X TAGS = ctags X X SIGNAL_DEFINES = -DSIGNALRETURNSINT X X PROTO_DEFINES = X X INSTPGMFLAGS = -s X X INSTBINFLAGS = -m 0755 X INSTUIDFLAGS = -m 4755 X INSTLIBFLAGS = -m 0664 X INSTINCFLAGS = -m 0444 X INSTMANFLAGS = -m 0444 X INSTDATFLAGS = -m 0444 X INSTKMEMFLAGS = -g kmem -m 2755 X X DESTDIR = X X TOP_INCLUDES = -I$(INCROOT) X X CDEBUGFLAGS = -O X CCOPTIONS = -Wf,-XNp6000,-XNd4000 X COMPATFLAGS = X X ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES) X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS) X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) X LDCOMBINEFLAGS = -X -r X X MACROFILE = mips.cf X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut X X IMAKE_DEFINES = X X IRULESRC = $(CONFIGDIR) X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES) X X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \ X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \ X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES) X X########################################################################### X# X Window System Build Parameters X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $ X X########################################################################### X# X Window System make variables; this need to be coordinated with rules X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $ X X PATHSEP = / X USRLIBDIR = $(DESTDIR)/software/x11,dev/lib X SHAREDUSRLIBDIR = $(DESTDIR)/software/x11,sun/lib X BINDIR = $(DESTDIR)/software/x11/bin X DEVBINDIR = $(DESTDIR)/software/x11,dev/bin X INCROOT = $(DESTDIR)/software/x11,dev/include X BUILDINCROOT = $(TOP) X BUILDINCDIR = $(BUILDINCROOT)/X11 X BUILDINCTOP = .. X INCDIR = $(INCROOT)/X11 X ADMDIR = $(DESTDIR)/software/x11/logs X LIBDIR = $(DESTDIR)/software/x11/data X CONFIGDIR = /software/x11,dev/data/config X LINTLIBDIR = $(USRLIBDIR)/lint X X FONTDIR = /software/font/data/x11/other X XINITDIR = $(LIBDIR)/xinit X XDMDIR = $(LIBDIR)/xdm X AWMDIR = $(LIBDIR)/awm X TWMDIR = $(LIBDIR)/twm X GWMDIR = $(LIBDIR)/gwm X MANPATH = $(DESTDIR)$(DESTDIR)/software/x11/man X MANSOURCEPATH = $(MANPATH)/man X MANDIR = $(MANSOURCEPATH)1 X LIBMANDIR = $(MANSOURCEPATH)3 X XAPPLOADDIR = /software/x11,minimal/data/app-defaults X X FONTCFLAGS = -t X X INSTAPPFLAGS = $(INSTDATFLAGS) X X IMAKE = imake X DEPEND = makedepend X RGB = rgb X FONTC = bdftosnf X MKFONTDIR = mkfontdir X MKDIRHIER = /bin/sh $(DEVBINDIR)/mkdirhier X X CONFIGSRC = $(TOP)/config X CLIENTSRC = $(TOP)/clients X DEMOSRC = $(TOP)/demos X LIBSRC = $(TOP)/lib X FONTSRC = $(TOP)/fonts X INCLUDESRC = $(TOP)/X11 X SERVERSRC = $(TOP)/server X UTILSRC = $(TOP)/util X SCRIPTSRC = $(UTILSRC)/scripts X EXAMPLESRC = $(TOP)/examples X CONTRIBSRC = $(TOP)/../contrib X DOCSRC = $(TOP)/doc X RGBSRC = $(TOP)/rgb X DEPENDSRC = $(UTILSRC)/makedepend X IMAKESRC = $(CONFIGSRC) X XAUTHSRC = $(LIBSRC)/Xau X XLIBSRC = $(LIBSRC)/X X XMUSRC = $(LIBSRC)/Xmu X TOOLKITSRC = $(LIBSRC)/Xt X AWIDGETSRC = $(LIBSRC)/Xaw X OLDXLIBSRC = $(LIBSRC)/oldX X XDMCPLIBSRC = $(LIBSRC)/Xdmcp X BDFTOSNFSRC = $(FONTSRC)/bdftosnf X MKFONTDIRSRC = $(FONTSRC)/mkfontdir X EXTENSIONSRC = $(TOP)/extensions X X DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a X EXTENSIONLIB = $(DEPEXTENSIONLIB) X X DEPXLIB = $(DEPEXTENSIONLIB) $(USRLIBDIR)/libX11.a X XLIB = $(EXTENSIONLIB) $(USRLIBDIR)/libX11.a X X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a X XAUTHLIB = $(DEPXAUTHLIB) X X DEPXMULIB = $(USRLIBDIR)/libXmu.a X XMULIB = $(DEPXMULIB) X X DEPOLDXLIB = $(USRLIBDIR)/liboldX.a X OLDXLIB = $(DEPOLDXLIB) X X DEPXTOOLLIB = $(USRLIBDIR)/libXt.a X XTOOLLIB = $(DEPXTOOLLIB) X X DEPXAWLIB = $(USRLIBDIR)/libXaw.a X XAWLIB = $(DEPXAWLIB) X X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln X LINTXLIB = $(USRLIBDIR)/llib-lX11.ln X LINTXMU = $(USRLIBDIR)/llib-lXmu.ln X LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln X LINTXAW = $(USRLIBDIR)/llib-lXaw.ln X X DEPLIBS = $(LOCAL_LIBRARIES) X X DEPLIBS1 = $(DEPLIBS) X DEPLIBS2 = $(DEPLIBS) X DEPLIBS3 = $(DEPLIBS) X X########################################################################### X# Imake rules for building libraries, programs, scripts, and data files X# rules: $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $ X X########################################################################### X# start of Imakefile X X OBJS = xtattr.o X SRCS = xtattr.c X X PROGRAM = xtattr X Xall:: xtattr X Xxtattr: $(OBJS) $(DEPLIBS) X $(RM) $@ X $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) X Xinstall:: xtattr X $(INSTALL) -c $(INSTPGMFLAGS) xtattr $(BINDIR) X Xinstall.man:: xtattr.man X $(INSTALL) -c $(INSTMANFLAGS) xtattr.man $(MANDIR)/xtattr.1 X Xdepend:: X $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS) X Xlint: X $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS) Xlint1: X $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS) X Xclean:: X $(RM) $(PROGRAM) X X########################################################################### X# common rules for all Makefiles - do not edit X Xemptyrule:: X Xclean:: X $(RM_CMD) \#* X XMakefile:: X -@if [ -f Makefile ]; then \ X echo " $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \ X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \ X else exit 0; fi X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) X Xtags:: X $(TAGS) -w *.[ch] X $(TAGS) -xw *.[ch] > TAGS X X########################################################################### X# empty rules for directories that do not have SUBDIRS - do not edit X Xinstall:: X @echo "install in $(CURRENT_DIR) done" X Xinstall.man:: X @echo "install.man in $(CURRENT_DIR) done" X XMakefiles:: X Xincludes:: X X########################################################################### X# dependencies generated by makedepend X END_OF_FILE if test 8642 -ne `wc -c <'xtattr/Makefile'`; then echo shar: \"'xtattr/Makefile'\" unpacked with wrong size! fi # end of 'xtattr/Makefile' fi if test -f 'xtattr/xtattr.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xtattr/xtattr.c'\" else echo shar: Extracting \"'xtattr/xtattr.c'\" \(5806 characters\) sed "s/^X//" >'xtattr/xtattr.c' <<'END_OF_FILE' X/* X * Set control strings to change the attributes of xterm windows. X * This was is for X10, and the kitchen-sink xterm, but it's been X * scaled down for X11 R4. X * X * John Sellens X * Math Faculty Computing Facility X * University of Waterloo X * jmsellens@watmath.waterloo.edu X */ X X#define X11 X X#include X X#define private static X#define CPNULL ((char *)NULL) X#define TITLE (-1) /* nargs value for title lines for help */ X X Xtypedef struct command { X char *flag; X int nargs; X char *format; X char *descrip; X} command; X Xprivate command comlist[] = { X{ "Window Attributes", TITLE, CPNULL, CPNULL }, X#ifdef X10 X { "-name", 1, "\033]0;%s\007", "Change window name" }, X#endif X#ifdef X11 X { "-name", 1, "\033]0;%s\007", "Change title and icon name" }, X { "-icon", 1, "\033]1;%s\007", "Change icon name" }, X { "-title", 1, "\033]2;%s\007", "Change window title" }, X { "-display",0, "\033]51;\007", "echo DISPLAY as keyboard input" }, X { "-displayfile",1, "\033]51;%s\007", "Write DISPLAY name to file" }, X { "-hostname",0, "\033]52;\007", "echo hostname as keyboard input" }, X { "-hostnamefile",1,"\033]52;%s\007", "Write hostname to file" }, X#endif X { "-logfile",1, "\033]46;%s\007", "Change log file name" }, X { "-scinv", 0, "\033[?5h", "Use inverse video" }, X { "-noscinv",0, "\033[?5l", "Don't use inverse video" }, X { "-scalt", 0, "\033[?47h", "Use alternate screen" }, X { "-noscalt",0, "\033[?47l", "Use normal screen" }, X#ifdef X10 X{ "Status Lines", TITLE, CPNULL, CPNULL }, X { "-slinv", 0, "\033[?48h", "Inverse video status line" }, X { "-noslinv",0, "\033[?48l", "Normal video status line" }, X { "-slerase",0, "\033[?E", "Erase status line" }, X { "-slreturn",0, "\033[?F", "Return from status line" }, X { "-slhide",0, "\033[?H", "Hide status line" }, X { "-slshow",0, "\033[?S", "Show status line" }, X { "-slcol", 1, "\033[?%sT", "Go to status line column" }, X#endif X{ "Scrolling and Scroll Bars", TITLE, CPNULL, CPNULL }, X { "-jump", 0, "\033[?4l", "Jump scroll" }, X { "-ooze", 0, "\033[?4h", "Slow scroll" }, X#ifdef X10 X { "-save", 0, "\033[?43h", "Save lines off top" }, X { "-nosave",0, "\033[?43l", "Don't save lines off top" }, X { "-scroll",0, "\033[?42h", "Show Scrollbar" }, X { "-noscroll",0, "\033[?42l", "Hide Scrollbar" }, X { "-page", 0, "\033[?49l", "Page scroll mode" }, X { "-nopage",0, "\033[?49h", "No Page scroll (normal) mode"}, X#endif X{ "Character Attributes", TITLE, CPNULL, CPNULL }, X { "-normal",0, "\033[0m", "Normal characters" }, X { "-blink", 0, "\033[1m", "Blink (bold) characters" }, X { "-ul", 0, "\033[4m", "Underlined characters" }, X { "-bold", 0, "\033[5m", "Bold characters" }, X { "-inv", 0, "\033[7m", "Inverse video characters" }, X#ifdef X10 X{ "Size & Shape", TITLE, CPNULL, CPNULL }, X { "-move", 2, "\033[3;%s;%st", "Move window (x y)" }, X { "-raise", 0, "\033[5t", "Raise window" }, X { "-lower", 0, "\033[6t", "Lower window" }, X { "-redraw",0, "\033[7t", "Redraw window" }, X { "-resize",2, "\033[8;%s;%st", "Resize window (rows cols)"}, X { "-resizep",2, "\033[4;%s;%st", "Resize window (w h pixels)"}, X#endif X{ "Miscellaneous", TITLE, CPNULL, CPNULL }, X { "-verb", 1, "%s", "Copy arg to window" }, X#ifdef X10 X { "-font", 1, "\033]47;%s\033", "Change normal font" }, X { "-fontb", 1, "\033]48;%s\033", "Change bold font" }, X#endif X#ifdef X11 X { "-font", 1, "\033]50;%s\007", "Change normal font" }, X { "-fontb", 1, "\033]50;;%s\007", "Change bold font" }, X { "-fonts", 2, "\033]50;%s;%s\007", "Change normal & bold fonts" }, X#endif X X { CPNULL, 0, CPNULL, CPNULL } X}; X X Xprivate char *progname; Xprivate char **argv; Xprivate int argc; Xprivate int arg; Xprivate char *flag; X X Xmain( real_argc, real_argv ) Xint real_argc; Xchar *real_argv[]; X{ X progname = real_argv[0]; X argc = real_argc; X argv = real_argv; X doit(); X exit( 0 ); X} X Xchar * Xnextarg() X{ X if ( ++arg >= argc ) X usage("Missing argument(s) for '%s' flag", flag ); X return( argv[arg] ); X} X X Xdoit() X{ X int i; X char *arg1; X if ( argc == 1 ) X usage( "at least one argument required" ); X for ( arg=1; arg'xtattr/xtattr.man' <<'END_OF_FILE' X.TH XTATTR 1 UofW X.SH NAME Xxtattr \- modify xterm window attributes X.SH SYNOPSIS X.I xtattr X.RI [ options ] X.SH DESCRIPTION X.I xtattr Xprovides an easy way to change the attributes of an xterm window. XYou can use it to change the window name, size, location, video Xattributes, etc. X.PP XUse X.IP Xxtattr -help X.PP Xto get a usage message. The program is designed so that the usage Xmessage and the options the program will understand can not get Xout of step with each other. X.SH "SEE ALSO" Xxterm(1), xdisplay(1) X.SH BUGS XDoesn't do all xterm escape sequences. X.br XDoesn't do bounds checking on input. X.br XSome things won't work in Tek window. X.SH "AUTHOR" X.nf XJohn Sellens XMath Faculty Computing Facility XUniversity of Waterloo Xjmsellens@watmath.waterloo.edu X.fi END_OF_FILE if test 757 -ne `wc -c <'xtattr/xtattr.man'`; then echo shar: \"'xtattr/xtattr.man'\" unpacked with wrong size! fi # end of 'xtattr/xtattr.man' fi echo shar: End of shell archive. exit 0