# This is a sample .twmrc file for Don's version of tvtwm with pie menus.
# Put it in your "~/.twmrc" or "~/.tvtwmrc" file and run "piewm". 
# Click the right mouse button on window headers or the root to get
# a pie menu, or hold down meta and click right anywhere on a window.
# This version of piewm supports pictures for pie menu labels. 
# Put xpm or xbm files in your "~/bitmaps" directory, and use
# them by specifying a menu label beginning with "_" followed by
# the name of the image file.

TitleFont "lucidasans-bold-14"
ResizeFont "lucidasans-12"
MenuFont "lucidasans-12"
MenuTitleFont "lucidasans-bold-12"
IconFont "lucidasans-bold-14"
IconManagerFont "lucidasans-12"

Monochrome {
	BorderColor			"black"
	IconBorderColor			"black"
	TitleForeground			"black"
	TitleBackground			"white"
	MenuForeground			"black"
	MenuBackground			"white"
	MenuTitleForeground		"white"
	MenuTitleBackground		"black"
	IconForeground			"black"
	IconBackground			"white"
	DefaultForeground		"white"
	MenuShadowColor			"black"
	IconBorderColor			"black"
	IconManagerBackground		"white"
	IconManagerForeground		"black"
}

Color {
	BorderColor			"gray25"
	IconBorderColor			"gray50"
	TitleForeground			"black"
	TitleBackground			"white"
	MenuForeground			"black"
	MenuBackground			"white"
	MenuTitleForeground		"white"
	MenuTitleBackground		"black"
	IconForeground			"black"
	IconBackground			"white"
	VirtualDesktopBackground	"gray50"
	PannerBackground		"gray50"
	DefaultForeground		"gray85"
	MenuShadowColor			"gray25"
	IconBorderColor			"gray85"
	IconManagerBackground		"white"
	IconManagerForeground		"black"
}

#This variable indicates that border width of a window's frame should be set to
#the initial border width of the window, rather than to the value of
#\fBBorderWidth\fP.
#ClientBorderWidth

#.IP "\fBWarpCursor\fP [{ \fIwin-list\fP }]" 8
#This variable indicates that the pointer should be warped into windows when
#they are deiconified.  If the optional \fIwin-list\fP is given, the pointer
#will only be warped when those windows are deiconified.  This will
#also change the position of the virtual desktop if the unmapped window
#wasn't visible from the actual position.
#WarpCursor

#.IP "\fBOpaqueMove\fP" 8
#This variable indicates that the \fBf.move\fP function should actually move
#the window instead of just an outline so that the user can immediately see
#what the window will look like in the new position.  This option is typically
#used on fast displays (particularly if \fBNoGrabServer\fP is set).
#OpaqueMove

#.IP "\fBStayUpMenus\fP" 8
#This variable alters menu interaction.  By default, a menu item is selected
#when a mouse button is released over it.  This variable causes menu items to
#be selected on the next button press event.
#StayUpMenus

#.IP "\fBNoGrabServer\fP" 8
#This variable indicates that \fItwm\fP should not grab the server
#when popping up menus and moving opaque windows.
NoGrabServer

#.IP "\fBAutoRelativeResize\fP" 8
#This variable indicates that dragging out a window size (either when
#initially sizing the window with pointer Button2 or when resizing it) 
#should not wait until the pointer has crossed the window edges.
#Instead, moving
#the pointer automatically causes the nearest edge or edges to move by the
#same amount.  This allows allows the resizing windows that extend off 
#the edge of the screen.
#If the pointer is
#in the center of the window, or if the resize is begun by pressing a 
#titlebutton, \fItwm\fP will still wait for the pointer to cross a window
#edge (to prevent accidents).  This option is
#particularly useful for people who like the press-drag-release method of
#sweeping out window sizes.
AutoRelativeResize

#The \fBDontSqueezeTitle\fP list can be used to turn off squeezing on 
#certain titles.
SqueezeTitle

#.IP "\fBRestartPreviousState\fP" 8
#This variable indicates that 
#\fItwm\fP should attempt to use the WM_STATE property on client windows
#to tell which windows should be iconified and which should be left visible.
#This is typically used to make try to regenerate the state that the screen
#was in before the previous window manager was shutdown.
RestartPreviousState

#.IP "\fBForceIcons\fP" 8
#This variable indicates that icon pixmaps specified in the \fBIcons\fP
#variable should override any client-supplied pixmaps.
ForceIcons

#.IP "\fBShowIconManager\fP" 8
#This variable indicates that the icon manager window should be displayed when
#\fItwm\fP is started.  It can always be brought up using the
#\fBf.showiconmgr\fP function.
ShowIconManager

#.IP "\fBRandomPlacement\fP" 8
#This variable indicates that windows with no specified geometry should should
#be placed in a pseudo-random location instead of having the user drag out
#an outline.
RandomPlacement

#.IP "\fBDecorateTransients\fP" 8
#This variable indicates that transient windows (those containing a 
#WM_TRANSIENT_FOR property) should have titlebars.  By default, transients 
#are not reparented.
DecorateTransients

#.IP "\fBUsePPosition\fP \fIstring\fP" 8
#This variable specifies whether or not \fItwm\fP should honor 
#program-requested locations (given by the \fBPPosition\fP flag in the
#WM_NORMAL_HINTS property) in the absence of a user-specified position.
#The argument \fIstring\fP may have one of three values:  \fB"off"\fP
#(the default) 
#indicating that \fItwm\fP
#should ignore the program-supplied position, 
#\fB"on"\fP indicating that the position
#should be used, and 
#\fB"non-zero"\fP indicating that the position should used if
#it is other than (0,0).  The latter option is for working around a bug in 
#older toolkits.
UsePPosition		"non-zero"

#.IP "\fBBorderWidth\fP \fIpixels\fP" 8
#This variable specifies the width in pixels of the border surrounding
#all client window frames if \fBClientBorderWidth\fP has not been specified.
#This value is also used to set the border size of windows created by \fItwm\fP
#(such as the icon manager).  The default is 2.
BorderWidth		1

#.IP "\fBConstrainedMoveTime\fP \fImilliseconds\fP" 8
#This variable specifies the length of time between button clicks needed to
#begin
#a constrained move operation.  Double clicking within this amount
#of time when invoking \fBf.move\fP will cause the window only be moved 
#in a horizontal or vertical direction.  Setting this value to 0 will disable
#constrained moves.  The default is 400 milliseconds.
ConstrainedMoveTime	800

#.IP "\fBZoom\fP [ \fIcount\fP ]" 8
#This variable indicates that outlines suggesting movement of a window
#to and from its iconified state should be displayed whenever a window is
#iconified or deiconified.  The optional \fIcount\fP argument specifies the
#number of outlines to be drawn.  The default count is 8.
Zoom			25

#.IP "\fBVirtualDesktop\fP \fIstring\fP" 8
#This variable enables the Virtual Desktop feature and specifies
#the initial size of the desktop, either in pixels or in integral multiples
#of the screen size.
#The size is specified as a standard geometry string.
#If a width or height value is smaller than the width or
#height of the physical display, it is assumed to mean a multiple of the
#screen size, otherwise it is assumed to be in pixels.
#So to get a 2x2 sized Virtual Desktop
#across all platforms, one could use the string "2x2" to enable
#the desktop.
VirtualDesktop		"3x3"

#.IP "\fBIconRegion\fP \fIgeomstring\fP \fIvgrav hgrav gridwidth gridheight\fP"
#This variable specifies an area on the root window in which icons are placed
#if no specific icon location is provided by the client.  The \fIgeomstring\fP
#is a quoted string containing a standard geometry specification.
#If more than one
#\fBIconRegion\fP lines are given,
#icons will be put into the succeeding icon regions when the first is full.
#The \fIvgrav\fP argument should be either \fBNorth\fP or \fBSouth\fP and
#control and is used to control whether icons are first filled in from the
#top or bottom of the icon region.  Similarly, the \fIhgrav\fP argument should
#be either \fBEast\fP or \fBWest\fP and is used to control whether icons should
#be filled in from left from the right.  Icons are laid out within the region
#in a grid with cells \fIgridwidth\fP pixels wide and \fIgridheight\fP pixels 
#high.
IconRegion		"=300x500-0-0" South East  1 1

# Wait this number of milliseconds before popping up a pie menu.
PieMenuWait		100

# shaped pie menus look really ugly with a shadow:
nomenushadows

#.IP "\fBMoveDelta\fP \fIpixels\fP" 8
#This variable specifies the number of pixels the pointer
#must move before the \fBf.move\fP function starts working.  Also
#see the \fBf.deltastop\fP function.  The default is zero pixels.
MoveDelta		3

#.IP "\fBIconManagerGeometry\fP \fIstring\fP [ \fIcolumns\fP ]" 8
#This variable specifies the geometry of the icon manager window.  The 
#\fIstring\fP argument is standard geometry specification that indicates 
#the initial full size of the icon manager.  The icon manager window is
#then broken into \fIcolumns\fP pieces and scaled according to the number
#of entries in the icon manager.  Extra entries are wrapped to form
#additional rows.  The default number of columns is 1.
IconManagerGeometry	"=200x1000-25+50"

#.IP "\fBIconDirectory\fP \fIstring\fP" 8
#This variable specifies the directory that should be searched if 
#if a bitmap file cannot be found in any of the directories
#in the \fBbitmapFilePath\fP resource.  This is generally a poor way to
#do things.  It is much better to set your \fBbitmapFilePath\fP resource
#to what you want it to be in your resources file.
IconDirectory		"/usr/misc/.X11/include/X11/bitmaps/"

#.IP "\fBUnknownIcon\fP \fIstring\fP" 8
#This variable specifies the filename of a bitmap file to be
#used as the default icon.  This bitmap will be used as the icon of all
#clients which do not provide an icon bitmap and are not listed
#in the \fBIcons\fP list.
UnknownIcon		":xlogo"

#.IP "\fBDefaultFunction\fP \fIfunction\fP" 8
#This variable specifies the function to be executed when a key or button
#event is received for which no binding is provided.  This is typically
#bound to \fBf.nop\fP, \fBf.beep\fP, or a menu containing window operations.
DefaultFunction		f.beep

Icons { }
IconifyByUnmapping { }
NoTitle { }
AutoRaise { }
Pixmaps { }

Cursors {
	Frame		"top_left_arrow"
	Title		"top_left_arrow"
	Icon		"top_left_arrow"
	IconMgr		"top_left_arrow"
	Move		"fleur"
	Resize		"fleur"
	Menu		"sb_left_arrow"
	Button		"hand2"
	Wait		"watch"
	Select		"dot"
	Destroy		"pirate"
}

#
# Define some useful functions for motion-based actions.
#
Function "move-or-lower" { f.move f.deltastop f.lower }
Function "move-or-raise" { f.move f.deltastop f.raise }


RightTitleButton ":xlogo" = f.zoom


#Button =	KEYS :	CONTEXT :	FUNCTION
#-----------------------------------------------
Button1 =	:	title :		f.function "move-or-raise"
Button2 =	:	title :		f.function "move-or-lower"
Button3 =	:	title :		f.piemenu "Frame"
#
Button1 =	:	root :		f.piemenu "Windows"
Button2 =	:	root :		f.piemenu "Pan"
Button3 =	:	root :		f.piemenu "Frame"
#
Button1 =	:	icon :		f.iconify
Button2 =	:	icon :		f.move
Button3 =	:	icon :		f.piemenu "Frame"
#
Button3 =	m :	window :	f.piemenu "Frame"
Button3 =	m :	title :		f.piemenu "Frame"
#
Button3 =	m :	icon :		f.piemenu "Frame"
#

Button1 =	:	iconmgr :	f.raiselower
Button2 =	:	iconmgr :	f.iconify
Button3 =	:	iconmgr :	f.piemenu "Frame"

"R7" =		m :	all :		f.scrollhome
"R13" =		m :	all :		f.scrollback
"R9" =		m :	all :		f.previconmgr
"R15" =		m :	all :		f.nexticonmgr
"Up" =		m :	all :		f.upiconmgr
"Down" =	m :	all :		f.downiconmgr
"Left" =	m :	all :		f.lefticonmgr
"Right" =	m :	all :		f.righticonmgr

"L5" =		:	all :		f.raiselower
"L7" =		:	all :		f.iconify

# Menu definitions

# Wmconfig menu insert

piemenu "Frame" {
	"Resize"			f.resize
	"Refresh"			f.winrefresh
	"Raise"				f.raise
	"Icon"				f.iconify
	"Move"				f.move
	"Zoom"				f.piemenu "Zoom"
	"Lower"				f.lower
	"More"				f.piemenu "More"
}

piemenu "More" {
	"Blur"				f.unfocus
	"Focus"				f.focus
	"Zap"				f.piemenu "Zap"
	"Info"				f.identify
	"CMap"				f.colormap "next"
	"Stick"				f.stick
}

piemenu "Zap" @ 45 {
	"Oops"				f.beep
	"Oops"				f.beep
	"Destroy"			f.destroy
	"Delete"			f.delete
}

piemenu "Zoom" {
	"Right"				f.rightzoom
	"Tall"				f.zoom
	"Left"				f.leftzoom
	"Full"				f.fullzoom
}

piemenu "Windows" @ 90 {
	"Frame"				f.piemenu "Frame"
	"Pan"				f.piemenu "Pan"
	"Host"				f.piemenu "Host"
	"Shuffle"			f.circleup
	"Wmconfig"			f.piemenu "Wmconfig"
	"Person"			f.piemenu "Person"
	"Manage"			f.piemenu "Manage"
	"Program"			f.piemenu "Program"
	"Refresh"			f.refresh
}

piemenu "Manage" {
	"Panner"			f.panner
	"Settings"			f.piemenu "Settings"
	"Exit"				f.piemenu "Really Exit?"
	"Icons"				f.showiconmgr
	"Nothing"			f.nop
	"Restart"			f.piemenu "Really Restart?"
}

piemenu "Settings" {
	"Security"			f.piemenu "Security"
	"Auto Repeat"			f.piemenu "Auto Repeat"
	"Key Click"			f.piemenu "Key Click"
	"Bell"				f.piemenu "Bell"
}

piemenu "Security" @ 90 {
	"xhost +"			!"xhost +"
	"xhost -"			!"xhost -"
}

piemenu "Auto Repeat" @ 90 {
	"On"				!"xset r on"
	"Off"				!"xset r off"
}

piemenu "Key Click" @ 90 {
	"On"				!"xset c on"
	"Off"				!"xset c off"
}

piemenu "Bell" @ 90 {
	"On"				!"xset b on"
	"Off"				!"xset b off"
}

piemenu "Really Exit?" @ 45 {
	"Yes!"				f.quit
	"No."				f.beep
	"No."				f.beep
	"No."				f.beep
}

piemenu "Really Restart?" @ 45 {
	"No."				f.beep
	"Yes!"				f.restart
	"No."				f.beep
	"No."				f.beep
}

piemenu "Pan" {
	"Right"				f.scrollright
	"Goto"				f.menu "TwmWindows"
	"Up"				f.scrollup
	"Home"				f.scrollhome
	"Left"				f.scrollleft
	"Back"				f.scrollback
	"Down"				f.scrolldown
	"Quad"				f.piemenu "Quad"
}

piemenu "Quad" @ 45 {
	"NE"				f.scroll "+1+0"
	"NW"				f.scroll "+0+0"
	"SW"				f.scroll "+0+1"
	"SE"				f.scroll "+1+1"
}

piemenu "Program" {
	"emacs"				!"emacs -fn lucidasanstypewriter-bold-12 &"
	"Sound"				f.piemenu "Sound"
	"Utilities"			f.piemenu "Utilities"
	"Info"				f.piemenu "Info"
	"xterm"				!"xterm -sb -sl 500 &"
	"Games"				f.piemenu "Games"
	"console"			!"xterm -title Console -C -sb -sl 1000 &"
	"Graphics"			f.piemenu "Graphics"
}

piemenu "Sound" {
	"gaintool"			!"gaintool &"
	"audiotool"			!"csh -c 'setenv LD_LIBRARY_PATH /usr/xnews/lib; /usr/xnews/bin/audiotool' &"
	"cdplayer"			!"cdplayer &"
}

piemenu "Games" {
	"Some"				f.nop
	"Write"				f.nop
}

piemenu "Graphics" @ 90 {
	"snapshot"			!"csh -c 'setenv LD_LIBRARY_PATH /usr/xnews/lib; /usr/xnews/bin/snapshot' &"
	"xv"				!"xv &"
	"xmag"				!"sleep 1 ; xmag &"
}

piemenu "Info" @ 90 {
	"top"				!"xterm -sb -e top &"
	"ps aux"			!"xterm -sb -e /bin/csh -c 'ps aux | more ; cat' &"
	"netstat"			!"xterm -sb -e /bin/csh -c 'netstat -a | more ; cat' &"
}

piemenu "Utilities" {
	"ftp"				!"xterm -sb -sl 500 -e ftp &"
	"xlock"				!"csh -c 'setenv LD_LIBRARY_PATH /usr/xnews/lib; /usr/xnews/bin/xlock' &"
	"calendar"			!"csh -c 'setenv LD_LIBRARY_PATH /usr/xnews/lib; /usr/xnews/bin/cm' &"
	"oclock"			!"csh -c 'setenv LD_LIBRARY_PATH /usr/xnews/lib; /usr/xnews/bin/oclock' &"
	"xcalc"				!"csh -c 'setenv LD_LIBRARY_PATH /usr/xnews/lib; /usr/xnews/bin/xcalc' &"
	"xfontsel"			!"csh -c 'setenv LD_LIBRARY_PATH /usr/xnews/lib; /usr/xnews/bin/xfontsel' &"
	"perfmon"			!"csh -c 'setenv LD_LIBRARY_PATH /usr/xnews/lib; /usr/xnews/bin/perfmeter' &"
	"calctool"			!"csh -c 'setenv LD_LIBRARY_PATH /usr/xnews/lib; /usr/xnews/bin/calctool' &"
}

piemenu "Host" {
}

piemenu "Person" {
}
