[comp.windows.x] xlock -- trouble invoking && problems with TWM

harp@cadillac.CAD.MCC.COM (Christopher North-Keys) (01/11/90)

I made the following mods to xlock in order to get the bloody thing
to run on my favorite beastie:
...
 *        removed option for command line password
 *        added requirement for display to be "unix:0".
 * 22-Mar-88: Received Walter Milliken's comp.windows.x posting.
 * 10-Jan-90: Altered EventMasks in XGrabPointer from -1 to 0, and removed the
 *        aberrant XFree(XHostAddress *) call in order to run cleanly under
 *        X11R4 (harp).

XGrabPointer appears around lines 259 and 272.
The XHostAddress *XListHosts bogus XFree appears around line 237.

XFree maps to Xfree maps to free on the Suns, and should take a character
pointer.  Hence using XFree on a XHostAddress struct containing a char *
seemed like a bad idea.

The code now compiles cleanly under gcc, and I think the mods should be
put into the distribution.

-------------------

TWM has some problems, including (CAVEAT:  I may have missed the obvious):

Completely ignores internal font specs for title bars, etc.  Interesting,
it looks as though all the main users were hooked on helvetica (or trapped?),
for there is no mention (I don't think) of the problem in the docs.

Has problems with using the specifiec BorderColor on monochrome displays.
It should shift from 50% grey to white for highlighting windows, but fails.
This one is mentioned somewhere.

There is no provision (that I've been able to find, anyway), for grouping
windows on the fly, such as, say, a debugger, editor, xman, and shell in
a programming task group.  I believe there was some incomplete code for
this in the last version, and it would have enabled functions like
f.group-iconify.  The multiple Icon Managers could grow into this, though.

--  These problems are nothing, of course, when compared to the gains (except
maybe the font problems).  The annoying clear-to-white of dying windows is
gone, along with slow startup, seriously redundant binding syntax, high crash
rate, and the like.   The overall customization potential is lovely.  For
those into that sort of thing, anyway.

Here's my .twmrc, in case anyone knows why the fonts are failing.  Yes, the
"smooth" font is valid---look out for the four-columns tabs...

#**************************************************************************
#   File: .twmrc r3.22 Freitag.d.3.Nov.1989 (v20: Mittwoch.d.12.Juli.1989)
#   File: .twmrc r4.23  Montag.d.8.Jan.1990 (derived from X11R3 .twmrc)
#   Auth: Christoph. Alex. North-Keys
#   Tabs: 4-columns tabulation
#   Requ: elfshell v21.0 or later suggested.  Also, see comments herein.
#**************************************************************************

#
# Current non-standard dependencies
#	Files   :  ~/.twmrc.help ~/.twmrcinstruct
#	Programs:  see Functions   (less is assumed)
#	Environs:  XINITPID HOSTNICK HOSTNAME DPYMACH XENVIRONMENT

#
# Global parameters
#
AutoRelativeResize
BorderWidth		2
ButtonIndent	0
DefaultFunction	f.beep
DontMoveOff
DecorateTransients
FramePadding	1
NoRaiseOnResize
NoRaiseOnMove
OpaqueMove
RestartPreviousState
TitleButtonBorderWidth	1
WarpUnmapped
Zoom 16

WindowRing {"xterm" "emacs"}

#MenuFont        "*new century schoolbook*medium*-r-*-18-*"
#ResizeFont      "*new century schoolbook*medium*-r-*-24-*"
MenuFont		"smooth"
ResizeFont		"smooth"
TitleFont       "smooth"

NoTitle
{ "oclock" "xclock" "xbiff" "xckmail" "xtrek" }

SqueezeTitle {
	"xeyes"	center	0 0
}

IconifyByUnmapping
IconRegion "=256x256+0-0" South West 64 64
IconManagerGeometry "=200x1-0+0"
IconManagerFont		"*new century schoolbook*medium*-r-*-12-*"
IconDirectory       "~/xbitmaps"
IconFont            "*helvetica*medium*-r-*-10-*"
UnknownIcon  		"generic.icon"
SortIconManager

IconManagers {
	"xterm"	"=200x1-200+0"	2
}

IconManagerDontShow {"console" "oclock" "xclock" "xbiff"}

Icons {
	"xterm"         "xterm.icon"
	"console"       "xterm.icon"
	"xfd"		:	"xfont.icon"
	"xfed"			"xfont.icon"
}

Color
{
    BorderColor		"gray50"
    TitleForeground	"white"
    TitleBackground	"brown"
    MenuForeground	"white"
    MenuBackground	"ForestGreen"
    MenuTitleForeground	"red"
    MenuTitleBackground	"blue"
	MenuShadowColor		"DarkGreen"
    IconForeground		"yellow"
    IconBackground		"MediumBlue"
    IconBorderColor		"gray50"
	IconManagerBackground	"MediumBlue"
	IconManagerForeground	"yellow"
}

Monochrome
{
	DefaultBackground	"black"
	DefaultForeground	"white"
    BorderColor			"black"
    TitleForeground		"black"
    TitleBackground		"white"
	IconManagerBackground "black"
	IconManagerForeground "white"
}

#=============== B U T T O N == D E F I N I T I O N S ==============
#Contexts: window,title,icon,root,frame,iconmgr(m),all
#Button =	Mod		: Context	: Function

#	Raw
Button1	=			:	t		:	f.raise
Button2	=			:	t		:	f.move
Button3	=			:	t		:	f.lower
Button1	=			:	r		:	f.menu	"TwmWindows"
Button2	=			:	r		:	f.menu	"Armageddon"
Button3	=			:	r		:	f.menu	"Main Menu"
#	applications	:	w|i		:-----------------Reserved

#	Control
Button1	=	c		:	r		:	f.menu	"Pkg.Mcc.Com"
Button2	=	c		:	r		:	f.menu	"Mcc.Com"
Button3	=	c		:	r		:	f.menu	"University"
#	applications	:	w|i		:-----------------Reserved

#	Shift
Button1	=	s		:	r		:	f.menu	"Tools"
Button2	=	s		:	r		:	f.menu	"More Tools"
Button3	=	s		:	r		:	f.menu	"Still More Tools"
#	applications	:	w|c		:-----------------Reserved

#	Control-Shift
Button1	=	c|s		:	r		:	f.menu	"Preferences"
Button2	=	c|s		:	r		:	f.menu	"Environment"
Button3	=	c|s		:	r		:	f.menu	"Manager/Server"
#	applications	:	w|i		:-----------------Reserved

#	Meta
Button1	=	m		:	t		:	f.menu	"Window Primitives"
Button2	=	m		:	t		:	f.menu	"Window Zoom"
Button3	=	m		:	t		:	f.menu	"Window Spiffs"
Button1	=	m		:	r		:	f.circleup
Button2	=	m		:	r		:	f.refresh
Button3	=	m		:	r		:	f.circledown
Button1	=	m		:	w|i		:	f.raise
Button2	=	m		:	w|i		:	f.resize
Button3	=	m		:	w|i		:	f.lower

#	Control-Meta
Button1	=	c|m		:	r		:	f.menu	"Buffer File"
Button2	=	c|m		:	r		:	f.menu	"Backdrops"
Button3	=	c|m		:	r		:	f.menu	"Window Sex"
Button1	=	c|m		:	w|i		:	f.zoom
Button2	=	c|m		:	w|i		:	f.move
Button3	=	c|m		:	w|i		:	f.iconify

#	Shift-Meta
Button1	=	s|m		:	r|w		:	f.menu	"Window Primitives"
Button2	=	s|m		:	r|w		:	f.menu	"Window Zoom"
Button3	=	s|m		:	r|w		:	f.menu	"Window Spiffs"

#	Control-Shift-Meta
Button1	=	c|s|m	:	all		:	f.menu	"Information"
Button2	=	c|s|m	:	all		:	f.menu	"Icon Manager"
Button3	=	c|s|m	:	all		:	f.menu	"Expert"

#================ K E Y B O A R D == M A P P I N G S ===============

"L1"	=			:	all		:	f.file "~/.twmrc"
"L2"	=			:	all		:	f.restart
"L3"	=			:	all		:	f.showiconmgr
"L3"	=	s		:	all		:	f.hideiconmgr
"L5"	=			:	w		:	f.raise
"L5"	=	s		:	w		:	f.lower
"L7"	=			:	w|i		:	f.iconify
"L9"	=			:	all		:	f.warpring "next"
"L9"	=	s		:	all		:	f.warptoscreen "next"
"L10"	=			:	w|i		:	f.delete
"L10"	=	s		:	w|i		:	f.destroy

"R7"	=	s		:	all		:	f.backiconmgr
"R8"	=	s		:	all		:	f.upiconmgr
"R9"	=	s		:	all		:	f.previconmgr
"R10"	=	s		:	all		:	f.lefticonmgr
"R11"	=	s		:	all		:	f.identify
"R12"	=	s		:	all		:	f.righticonmgr
"R13"	=	s		:	all		:	f.forwiconmgr
"R14"	=	s		:	all		:	f.downiconmgr
"R15"	=	s		:	all		:	f.nexticonmgr

#================ F U N C T I O N == D E F I N I T I O N S =========

# WARNING:  Following requires the ~/.twrmc.help file
Function "help"
{
	!"xterm -name twmhelp -title '.twmrc help' -e less $HOME/.twmrc.help &"
}

# WARNING:  Following requires xopendesk in search path.
Function "xopendesk"
{
	f.showiconmgr
	!"xopendesk &"
}

# WARNING;  Following requires xloglock in search path.
Function "xloglock"
{
	!"xloglock &"
}

# WARNING;  Following requires kbd_mode in search path.
Function "kbd_mode"
{
	!"kbd_mode -u"
	f.beep
	f.beep
}
	
#================== M E N U == S P E C I F I C A T I O N S =========

# WARNING:  Following requires xloglock in search path.
Menu "Armageddon"
{
"ARMAGEDDON" 						f.title
"Undermine window's will to live"	f.delete
"Substitute might for persuasion"	f.destroy
"Family atomics and `Shai Halud'"	!"kill -TERM $XINITPID"
}

Menu "Main Menu"
{
"Main Menu"					f.title
"Lockscreen"				!"xlock &"
"Logged screen lock"		f.function "xloglock"
"Open Desktop"				f.function "xopendesk"
"Help"						f.function "help"
}

Menu "Abstracts@Pkg"
{
"Gatewayhost"	!"xterm -title Gatewayhost -e rlogin gatewayhost &"
"Mailhost"      !"xterm -title Mailhost    -e rlogin mailhost &"
"Dumphost"      !"xterm -title Dumphost    -e rlogin dumphost &"
}

Menu "Pkg.Mcc.Com"
{
"Pkg.Mcc.Com"   f.title
"Alpha"         !"xterm -title Alpha      -e rlogin alpha &"
"Arya"          !"xterm -title Arya       -e rlogin arya &"
"Eire"          !"xterm -title Eire       -e rlogin eire &"
"Elwonei"       !"xterm -title Elwonei    -e rlogin elwonei &"
"Gryphon"       !"xterm -title Gryphon    -e rlogin gryphon &"
"Jupiter2"      !"xterm -title Jupiter2   -e rlogin jupiter2 &"
"Mystic"        !"xterm -title Mystic     -e rlogin mystic &"
"Pi"            !"xterm -title Pi         -e rlogin pi &"
"Pluto"         !"xterm -title Pluto      -e rlogin pluto &"
"Rock"			!"xterm -title Rock       -e rlogin rock &"
"Terra"         !"xterm -title Terra      -e rlogin terra &"
"(Abstracts)"	f.menu	"Abstracts@Pkg"
}

Menu "Mcc.Com"
{
"Mcc.Com"		f.title
"Mcc"			!"xterm -title Mcc.Com    -e telnet mcc.com &"
"Cadillac"		!"xterm -title Cadillac   -e rlogin cadillac &"
"Tigre"			!"xterm -title Tigre      -e rlogin tigre &"
"Milano"		!"xterm -title Milano     -e telnet milano &"
}

Menu "University"
{
"Univ-Texas"		f.title
"CC WF"				f.menu "UTCC-WF"
"CC WF Lab"			f.menu "UTCC-WFLAB"
"CC Iv/Ix/Cdc"		f.menu "UTCC-I"
"CC Utaus (UTCAT)"	!"xterm -title UTCAT	  -e telnet utaus.cc.utexas.edu &"
"CC Miscellaneous"  f.menu "UTCC-MISC"
"Emx"   			!"xterm -title Emx		  -e telnet emx.utexas.edu &"
"Chpc (Cray)"		!"xterm -title Chpc		  -e telnet chpc.brc.utexas.edu &"
"Research-20"	  	!"xterm -title Res-20	  -e telnet r20.utexas.edu &"
"Agl"				!"xterm -title Agl		  -e telnet agl.cc.utexas.edu &"
}

Menu "UTCC-WF"
{
"VonDrake"		!"xterm -title VonDrake	  -e telnet vondrake.cc.utexas.edu &"
"SnowWhite"		!"xterm -title SnowWhite  -e telnet snowwhite.cc.utexas.edu &"
"Walt"			!"xterm -title Walt		  -e telnet walt.cc.utexas.edu &"
"Scrooge"		!"xterm -title Scrooge	  -e telnet scrooge.cc.utexas.edu &"
"Mickey"		!"xterm -title Mickey	  -e telnet mickey.cc.utexas.edu &"
"Minney"		!"xterm -title Minnie	  -e telnet minnie.cc.utexas.edu &"
"Donald (lw4)"	!"xterm -title Donald	  -e telnet donald.cc.utexas.edu &"
"Daisy"			!"xterm -title Daisy	  -e telnet daisy.cc.utexas.edu &"
"Huey"			!"xterm -title Huey		  -e telnet huey.cc.utexas.edu &"
"Dewey"			!"xterm -title Dewey	  -e telnet dewey.cc.utexas.edu &"
"Louie"			!"xterm -title Louie	  -e telnet louie.cc.utexas.edu &"
"Goofy"			!"xterm -title Goofy	  -e telnet goofy.cc.utexas.edu &"
"Dumbo"			!"xterm -title Dumbo	  -e telnet dumbo.cc.utexas.edu &"
}

Menu "UTCC-WFLAB"
{
"Happy"			!"xterm -title Happy		-e telnet happy.cc.utexas.edu &"
"Sleepy"		!"xterm -title Sleepy		-e telnet sleepy.cc.utexas.edu &"
"Doc"			!"xterm -title Doc			-e telnet doc.cc.utexas.edu &"
"Grumpy"		!"xterm -title Grumpy		-e telnet grumpy.cc.utexas.edu &"
"Sneezy"		!"xterm -title Sneezy		-e telnet sneezy.cc.utexas.edu &"
"Bashful"		!"xterm -title Bashful		-e telnet bashful.cc.utexas.edu &"
"Dopey"			!"xterm -title Dopey		-e telnet dopey.cc.utexas.edu &"
}
Menu "UTCC-I"
{
"Ix1"   		!"xterm -title Ix1		  -e telnet ix1.cc.utexas.edu &"
"Ix2 (UTCCIX)"	!"xterm -title Ix2		  -e telnet ix2.cc.utexas.edu &"
"Iv1"   		!"xterm -title Iv1		  -e telnet iv1.cc.utexas.edu &"
"Iv2"   		!"xterm -title Iv2		  -e telnet iv2.cc.utexas.edu &"
"Iv3"   		!"xterm -title Iv3		  -e telnet iv3.cc.utexas.edu &"
"Iv4"   		!"xterm -title Iv4		  -e telnet iv4.cc.utexas.edu &"
"Dinosaur"		!"xterm -title Dinosaur	  -e telnet dinosaur.cc.utexas.edu &"
}

Menu "UTCC-MISC"
{
"Tardis"		!"xterm -title Tardis	  -e telnet tardis.cc.utexas.edu &"
"Sirius"		!"xterm -title Sirius	  -e telnet sirius.cc.utexas.edu &"
}

Menu "Tools"
{
"Tools"					f.title
"Terminal"				!"xterm -title $HOSTNICK &"
"Calculator (HP)"		!"xcalc -stip -rpn &"
"Calculator (TI)"		!"xcalc &"
"Calendar"				!"xcalendar &"
"Emacs"					!"emacs &"
"Emacs (remote)"		!"remacs &"
"X FrameMaker"			!"xmaker &"
"Magnifier"				!"xmag &"
"Manual Pages"			!"xman &"
"Perfmon"				!"xperfmon &"
"XShell"				!"xshell &"
"GNUplot"				!"xterm -T GNUplot -e gnuplot &"
}

Menu "More Tools"
{
"More Tools"			f.title
"Terminal (smooth)"		!"xterm -title $HOSTNICK -fn smooth &"
"Timepiece (square)"	!"xclock &"
"Timepiece (ellipse)"	!"oclock &"
"Mailcheck"				!"rxbiff &"
"Load Record"			!"xload -rv &"
"Editor"				!"xedit &"
"Mail watch"			!"xbiff &"
"Magnifier (2X)"		!"xmag -mag 2 &"
"Magnifier (128 bits)"	!"xmag -source 128x128 &"
"X Event Proto"			!"xev &"
}

Menu "Still More Tools"
{
"Still More Tools"		f.title
"Ico"					!"ico &"
"Muncher"				!"muncher &"
"Plaid"					!"plaid &"
"Puzzle"				!"puzzle &"
"X Logo"				!"xlogo &"
"X Eyes"				!"xeyes &"
}

Menu "Window Sex"
{
"Window Sex"          f.title
"Shell Sex"           f.title
"Shell - Introverted" !"xterm -rv -e ish &"
"Shell - Bourne"	  !"xterm -rv -e sh &"
"Shell - C"			  !"xterm -rv -e csh &"
"Shell - Tc"		  !"xterm -rv -e tcsh &"
"Shell - Korn"        !"xterm -rv -e ksh &"
}

Menu "Manager/Server"
{
"Manager/Server"	f.title
"X Manager"			f.title
"---rlogin"			!"xterm -title $HOSTNICK -e rlogin $HOSTNAME &"
"---telnet"			!"xterm -title $HOSTNICK -e telnet $HOSTNAME &"
"X Server"			f.title
"---rlogin"			!"xterm -title $DPYMACH  -e rlogin $DPYMACH &"
"---telnet"			!"xterm -title $DPYMACH  -e telnet $DPYMACH &"
}

Menu "Environment"
{
"Environment"		f.title
"Next Colormap"		f.colormap "next"
"Prev Colormap"		f.colormap "prev"
"Base Colormap"		f.colormap "default"
}

Menu "Backdrops"
{
"Backdrops"			f.title
"Expanded Consciousness"	f.title
"Starfield"			!"xsetroot -bitmap /net/lib/bitmaps/stars.bitmap &"
"Tesselations"		f.title
"Chainmail" 		!"xsetroot -bitmap /net/lib/bitmaps/chain.bitmap &"
"Reptiles-Escher"	!"xsetroot -bitmap /net/lib/bitmaps/reptiles.bitmap &"
"Reptiles"			!"xsetroot -bitmap /net/lib/bitmaps/reptiles_cnil.bitmap &"
"Triangles"			!"xsetroot -bitmap /net/lib/bitmaps/triangles.bitmap &"
"Hexes"				!"xsetroot -bitmap /net/lib/bitmaps/hexes.bitmap &"
}

Menu "Preferences"
{
"Preferences"	f.title
"Query"			!"xset q &"
"Bell Volume"	f.title
"Loud"			!"xset b 100 &"
"Normal"		!"xset b 50 &"
"Off"			!"xset b off &"
"Key Click"		f.title
"Loud"			!"xset c 100 &"
"Soft"			!"xset c 30 &"
"Off"			!"xset c off &"
"Capitals"		f.title
"Locked"		!"xset l on &"
"Unlocked"		!"xset l off &"
"Squeek!"		f.title
"Fast"			!"xset m 20 5 &"
"Normal"		!"xset m default &"
"Slow"			!"xset m 1 1 &"
"Autorepeat"	f.title
"On"			!"xset r on &"
"Off"			!"xset r off &"
"Screen Saver"	f.title
"On"			!"xset s default &"
"Blanking"		!"xset s blank &"
"Patterning"	!"xset s noblank &"
"Off"			!"xset s off &"
}

Menu "Window Primitives"
{
"Lesser Window Ops" f.title
"Forcemove"			f.forcemove
"(De)Iconify"		f.iconify
"Move"				f.move
"Resize"			f.resize
"Lower"				f.lower
"Raise"				f.raise
"Refresh"			f.winrefresh
"Circulate Up"		f.circleup
"Circulate Down"	f.circledown
"Set Autoraising"	f.autoraise
"Focus Keyboard"	f.focus
"Unfocus Keyboard"	f.unfocus
"Save State"		f.saveyourself
}

Menu "Window Zoom"
{
"Zoom Options"	f.title
"Full"			f.fullzoom
"Right"			f.rightzoom		#f.vrzoom
"Up"			f.topzoom		#f.htzoom
"Left"			f.leftzoom		#f.vlzoom
"Down"			f.bottomzoom	#f.hbzoom
"Horizontal"	f.horizoom		#f.hzoom
"Vertical"		f.zoom
}

Menu "Window Spiffs"
{
"Greater Window Ops"			f.title
"Dump to default laser"			!"xdpr -device ps &"
"Dump to default laser (inv)"	!"xdpr -device ps -rv &"
}

# WARNING:  Following requires less in search path.
Menu "Information"
{
"Information"			f.title
"Version"				f.version
"(paged) Display Info"	!"xterm -name info -title xpyinfo  -e sh -c 'xdpyinfo | less' &"
"(paged) Window Info"	!"xterm -name info -title xwininfo -e sh -c 'xwininfo | less' &"
"(paged) Font List"		!"xterm -name info -title xlsfonts -e sh -c 'xlsfonts | less' &"
"(paged) Window List"	!"xterm -name info -title xlswins  -e sh -c 'xlswins  | less' &"
"(paged) Colour List"	!"xterm -name info -title xcolours -e sh -c 'less /net/lib/X11/rgb.txt' &"
"(paged) Server Envir"	!"xterm -name info -title environ  -e sh -c 'env | less' &"
"Palette"				!"xpalette &"
"Colors"				!"xcolors &"
}

Menu "Expert"
{
"Expert"					f.title
"Win Manager Reincarnate"	f.twmrc
"Win Manager Eradicate"		f.quit
"Win Manager Instruct"		f.source "~/.twmrcinstruct"
"IconManagerExpose"		f.showiconmgr
"IconManagerHide"		f.hideiconmgr
"Reload XEnvironment"		!"(xrdb -load ${XENVIRONMENT})&"
"Restore Sun Keyboard"      !"kbd_mode -u"
}

Menu "left"
{
"left"		f.title
}

Menu "middle"
{
"middle"	f.title
}

Menu "right"
{
"right"		f.title
}

#============================End of file twmrc===================#
	
-- 
------------------------------------/\----------------------------------------
Seo:  Harp[@Mcc.Com]               /  \/\ ^*^           Christopher North-Keys
Tha mi gu trang a'cluich.         /    \ \          Systems Administrator, MCC
------------------------------------------------------------------------------