#**********************************************************************
#
#    .twmrc
#
#**********************************************************************

NoVersion
NoGrabServer
NoRaiseOnMove
NoRaiseOnResize
NoMenuShadows
#NoTitleHighlight
#NoHighlight
#TitleFocus
NoTitleFocus
SqueezeTitle
ConstrainedMoveTime 0
DecorateTransients
OpaqueMove
ClientBorderWidth
BorderWidth 1
RandomPlacement
RestartPreviousState
XorValue 16777215
#XorValue 9
IconRegion "450x200-200+0" EAST NORTH 75 25
TitleFont "fixed"
MenuFont "5x8"
IconFont "fixed"
ResizeFont "fixed"
IconManagerFont "fixed"

RightTitleButton ":delete" = f.delete

Cursors
{
        Button "left_ptr"
        Menu "left_ptr"
        Title "left_ptr"
        Frame "left_ptr"
        Icon "left_ptr"
}

Color
{
    BorderColor "black"
#    TitleBackground "CIExyY:0.214117/0.293398/0.188166"
    TitleBackground "cadetblue"
    TitleForeground "#fffff0"
    MenuBackground "NavyBlue"
    MenuForeground "#fffff0"
#    MenuTitleBackground "CIExyY:0.214117/0.293398/0.188166"
    MenuTitleBackground "cadetblue"
    MenuTitleForeground "#fffff0"
    IconBackground "#fffff0"
    IconForeground "black"
    IconBorderColor "black"
}


Monochrome
{
        IconManagerHighlight "white"
}

NoTitle
{
  "clock"
  "oclock"
  "xbiff"
  "xeyes"
  "xapm"
  "fscrib"
}

NoStackMode
{
        "saber"
}

IconManagerDontShow {
        "clock"
        "oclock"
        "xclock"
        "xbiff"
        "xeyes"
        "xapm"
}

# define key bindings

MoveDelta 7

Function "delete-or-destroy"
{
        f.delete
        f.destroy
}

Function "move-or-raise"
{
        f.move
        f.deltastop
        f.focus
        f.raise
}

Function "move-or-raiselower"
{
        f.move
        f.deltastop
        f.focus
        f.raiselower
}

Function "move-or-iconify"
{
        f.move
        f.deltastop
        f.iconify
}

menu "CPS"
{
"CPS Apps" f.title
"Keyboard" !"launchKeyboard.sh&"
"Gridwrite" !"launchGridwrite.sh&"
"Contacts"  !"showpim.sh address&"
"Todo"  !"showpim.sh todo&"
}

menu "Apps"
{
"Apps" f.title
"Terminal S" !"rxvt -sb -fn 5x8 -geometry 50x13+0-0&"
"Terminal B" !"rxvt -sb -fn 6x13 -geometry 50x13+0-0&"
"top" !"rxvt -sb -fn 5x8 -geometry =80x21+0-0 -e top&"
"Recognizer" !"xscribble&"
"Fullscreen Recognizer" !"fscrib &"
"Keyboard" !"xvkbd -ipaq -compact -geom 230x80&"
"xeyes"    !"xeyes -geom -0-0 &"
"Calculator" !"xcalc -fg red -geom +30+0&"
"rclock" !"rclock -fn 8x13&"
"xlogo" !"xlogo -bg DarkTurquoise -geom 75x75+130+75 &"
"xload" !"xload -geom 100x50-0+0 -fg green -bg red &"
"gqmpeg" !"rxvt -e /usr/X11R6/bin/gqmpeg /usr/local/mp3/*.mp3 &"
"chimera" !"cd /tmp; /usr/X11R6/bin/chimera&"
"Games" f.menu "Games"
"System" f.menu "System"
}

menu "FrontLight"
{
"Off" !"bl 1 0 0"
"Minimum" !"bl 1 1 0"
"16" !"bl 1 1 16"
"32" !"bl 1 1 32"
"64" !"bl 1 1 64"
"128" !"bl 1 1 128"
"Maximum" !"bl 1 1 255"
}

menu "ScreenSaver"
{
"Activate" !"xset s activate"
"10 Seconds" !"xset s 10 10"
"60 Seconds" !"xset s 60 60"
"5 Minutes" !"xset s 300 300"
"Default" !"xset s default"
"Off" !"xset s off"
}

menu "Games"
{
	"Keith's Klondike" !"/usr/X11R6/bin/kklondike -geometry =310x220+0+0 &"
	"Keith's Aces"     !"/usr/X11R6/bin/kaces -geometry =310x220+0+0 &"
}

menu "System"
{
        "System" f.title
        "Window ops" f.menu "Window Ops"
        "" f.nop
        "Refresh" f.refresh
        "Unfocus" f.unfocus
        "" f.nop
	"Insert PCMCIA/CF" !"xterm -e bash -c 'cardctl insert 0'"
	"Eject  PCMCIA/CF"  !"xterm -e bash -c 'cardctl eject 0'"
	"Status  PCMCIA/CF"  !"xterm -e bash -c 'cardctl status 0'"
	"mount /usr/local"  !"xterm -e bash -c 'mount /dev/hda1 /usr/local'"
        "" f.nop
        "Calibrate Screen" !"xcalibrate &"
        "Recognizer" !"xscribble &"
        "Fullscreen Recognizer" !"xscribble-fs &"
        "Screen Saver" f.menu "ScreenSaver"
        "Front Light" f.menu "FrontLight"
        "" f.nop
        "Event Tester" !"xev &"
        "" f.nop
        "Reboot" !"shutdown -r now"
        "Shut Down" !"shutdown -h now"
}

menu "Window Ops"
{
        "Window Ops" f.title
        "Lower" f.lower
        "Raise" f.raise
        "Resize" f.resize
        "Move" f.move
        "Deiconify" f.deiconify
        "Iconify" f.iconify
        "Identify" f.identify
        "Next Screen" f.warptoscreen "next"
        "Focus" f.focus
        "Kill" f.destroy
        "Windows" f.menu "TwmWindows"
        "Show Icon Box" f.showiconmgr
        "Hide Icon Box" f.hideiconmgr
        "Version" f.version
}

WindowRing {
        "*"
        "!*clock*"
        "!xapm"
        "!xbiff"
        "!xcpu"
}

DefaultFunction f.nop

# With a stylus, only Button1 is interesting
Button1 = m : window|icon : f.function "move-or-raiselower"
Button1 = : title : f.function "move-or-raiselower"
Button1 = : root : f.menu "Apps"
Button1 = : icon : f.function "move-or-iconify"

# These 3 are a quick hack to workaround a bug in v0.17 where
# the control modifier seems to get stuck on
Button1 = c : title : f.function "move-or-raiselower"
Button1 = c : root : f.menu "Apps"
Button1 = c : icon : f.function "move-or-iconify"

# These can still be useful if you hook up a multi-button mouse, (x2x!)
Button2 = : title : f.function "move-or-raiselower"
Button3 = : title : f.function "move-or-raiselower"
Button2 = m : window|icon : f.iconify
Button3 = m : window|icon : f.resize
Button3 = c m : title : f.destroy
Button3 = : root : f.menu "System"
Button2 = : icon : f.function "move-or-iconify"
Button3 = : icon : f.function "move-or-iconify"
"Tab" = s c : all : f.warpring "prev"
"Tab" = c : all : f.warpring "next"
"Execute" = : title|window|icon : f.fullzoom
#Button3 = : root : f.quit
