# from the template /lusr/share/udb/adm/base/dotfile/twmrc
#**********************************************************************
#
#    .twmrc
#
#**********************************************************************
#
# Use the SHAPE extension to make titles use as little space as possible.  The
# location of the titles is specified as a fraction of the distance from the
# left (numerator positive) or right edge (numerator negative).  A denominator
# of 0 indicates that the numerator is measured in pixels.  The title is then
# justified over the indicated spot (note special cases are made for center on
# 0/0 and right on 0/0 to indicate the center and right edge of the titlebar).
#
SqueezeTitle			# also sets default to Squeeze all Titles
{
#   name	justify	num denom
    "oclock"	center	  0  0		# centered over middle of title
    "XTerm"	left	  0  0		# left edge of title
    "emacs"	right	  0  0		# left side emacs with center tab
}
#DontSqueezeTitle
#{
#}
NoDefaults			# turn off iconify and resize button
LeftTitleButton "menu12" = f.menu "windowmenu"	# add a menu to each window
TitleButtonBorderWidth 0	# don't want to see box around button
ButtonIndent 0			# button doesn't have to be smaller

UsePPosition "on"		# use program-specified size hints accepted
#NoHighlight			# do not flash borders on enter events
OpaqueMove			# actually move window instead of outline
AutoRelativeResize		# don't require resize to cross border to start
RestartPreviousState		# reiconify iconified things on startup
ClientBorderWidth		# use the application border width on frame
BorderWidth 2			# width of top level windows created by twm
NoGrabServer			# don't grab server during menus, etc.
NoRaiseOnMove			# allow moving under other windows
NoRaiseOnResize			# allow resizing under other windows
NoTitleFocus			# avoid keystrokes in wrong window cause of lag
DecorateTransients		# put titlebars on transients
TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*"
NoSaveUnders			# faster to just repaint then save
XORvalue 1			# tend to use visually distinct adjacent colors
ConstrainedMoveTime 0		# turn off horizontal/vertical only moving
NoCaseSensitive			# turn off case-sensitivity in sorting icons
WarpUnmapped			# allow warping to unmapped windows
WarpCursor			# warp to window on de-iconfiy

###############################################################################
#                                                                             #
#                           Declare some nice colors                          #
#                                                                             #
###############################################################################

Pixmaps
{
    TitleHighlight "dot"		# make it stand out
}

Color
{
    DefaultBackground "maroon"
    DefaultForeground "gray85"
    BorderColor "gray70"
    {
	"XTerm"	"red"
    }
    TitleBackground "maroon"
    TitleForeground "gray85"
    MenuBackground "maroon"
    MenuForeground "gray85"
    MenuTitleBackground "gray70"
    MenuTitleForeground "maroon"
    IconBackground "maroon"
    IconForeground "gray85"
    IconBorderColor "gray85"
    IconManagerBackground "maroon"
    IconManagerForeground "gray85"
    IconManagerHighlight "cyan"
}

Monochrome
{
    IconManagerHighlight  "black"
    BorderColor "black"
}

#AutoRaise
#{
#        "xterm"
#        "login"
#        "console"
#}

###############################################################################
#                                                                             #
#                             Define key bindings                             #
#                                                                             #
###############################################################################

MoveDelta 3			# need to move this much before takes effect
Function "move-or-raise"	# simulate uwm action
{
    f.move
    f.deltastop
    f.raise
}

Function "warp-to-window"
{
    f.iconify
    f.warpring "prev"
}

DefaultFunction f.nop		# ignore extraneous events

Button1 =	: root				: f.menu "twmops"
Button2 =	: root				: f.menu "windowops"
Button3 =	: root				: f.menu "TwmWindows"
Button1 =	: title				: f.function "move-or-raise"
Button1 =	: icon				: f.iconify
Button1 =	: iconmgr			: f.iconify
Button1	= m	: window|icon|frame|title	: f.lower
Button2	= m	: window			: f.resize
Button3	= m	: window|icon|frame|title	: f.function "move-or-raise"
Button1	= c|m|s	: root				: f.refresh
Button2 = c	: root				: f.menu "logins"
#"F20"	=	: all				: f.warptoscreen "next"

"F21"		=	: all			: f.warpring "next"
"F7"		=	: all			: f.warptoiconmgr ""
"F8"		=	: all			: f.raiselower
"R1"		=	: window		: f.iconify
"R1"		=	: iconmgr		: f.iconify
"R2"		=	: iconmgr		: f.function "warp-to-window"
"R3"		=	: all			: f.warptoiconmgr ""
"R4"		= m	: all			: f.backiconmgr
"R5"		= m	: all			: f.forwiconmgr
"R6"		= m	: all			: f.upiconmgr
"R7"		= m	: all			: f.downiconmgr


###############################################################################
#                                                                             #
#     Display an icon manager across the top of the screen.  Don't manage     #
#                the windows for which you don't show a title.                #
#                                                                             #
###############################################################################

SortIconManager			# keep them in alphabetic order
ShowIconManager			# start with iconmgr up
IconManagerGeometry "1000x50+246+2" 8	# strip across top
IconifyByUnmapping		# just use icon manager
IconManagerDontShow		# but ignore these windows
{
  "xbiff"
  "xload"
  "oclock"
  "xcutsel"
}
DontIconifyByUnmapping		# don't lose them (still in TwmWindows menu)
{
  "xbiff"
  "xload"
  "oclock"
  "xcutsel"
}
NoTitle				# little programs that look like icons
{
  "xclock"
  "xbiff"
  "xload"
  "TWM Icon Manager"
  "xcutsel"
  "oclock"
}

WindowRing			# f.warpring acts along these windows
{
    "XTerm"
    "emacs"
}


###############################################################################
#                                                                             #
#                          Define some useful menus.                          #
#                                                                             #
###############################################################################

menu "twmops"
{
"System"		f.title
"Restart Twm"		f.restart
"Exit Twm"		f.quit
""			f.nop
"xterm"			!"xterm &"
"xterm -e /bin/sh"	!"xterm -e /bin/sh &"
"xhost +"		!"xhost + >/dev/null"
"xhost -"		!"xhost - >/dev/null"
""			f.nop
}

# These hosts need to be changed to your favorite hosts and then
# uncommented.  The samples here are just 2 public machines.
# menu "logins"
#{
#"Logins"		f.title
#"plucky"		!"xterm -n plucky -e rlogin plucky &"
#"priddy"		!"xterm -n priddy -e rlogin priddy &"
#}

menu "windowops"
{
"Windows"		f.title
"Kill"			f.menu "kill"
"Save"			f.saveyourself
"Refresh"		f.refresh
""			f.nop
"Iconify"		f.iconify
"Resize"		f.resize
"Move"			f.move
"Raise"			f.raise
"Lower"			f.lower
"Info"			f.identify
"Focus"			f.focus
"Unfocus"		f.unfocus
}

menu "windowmenu"
{
"Iconify"		f.iconify
"RaiseLower"		f.raiselower
"Refresh"		f.winrefresh
"Focus"			f.focus
""			f.nop
"Kill"			f.menu "kill"
}

menu "kill"
{
    "Kill Window"	f.destroy
    "Send Delete"	f.delete
}
