##########################################################
# .ctwmrc                                                #
# Author:   Stefan Hagen <ctwm@textmail.me>              #
# Created:  06.05.2005                                   #
# Changed:  14.05.2019                                   #
##########################################################

NoDefaults                         # kill all default settings

###############################################
#-----------------> XINERAMA <----------------#
###############################################
#VirtualScreens {
#    "1366x768+0+0"
#    "1366x768+1366"
#}

###############################################
#-----------------> set fonts <---------------#
###############################################

MenuFont          "-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*"
TitleFont         "-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*"
IconManagerFont   "-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*"
IconFont          "-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*"
ResizeFont        "-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*"
WorkSpaceFont     "-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*"

################################################
#------------> set pixmap directory <----------#
################################################

PixmapDirectory   "/home/sdk/.ctwm/img"

################################################
#---------------> global settings <------------#
################################################

#RestartPreviousState              # use previous state, if saved
#AutoRaise                         # bring to front - automatically
#{
#  "MPlayer"
#}
#RaiseDelay 250                    # autoraise delay
RaiseOnClick                       # raise window when clicked on
#RaiseOnClickButton 3              # raise window when clicked with button
CenterFeedbackWindow               # popup windows to center screen
#TransientHasOccupation            # allow other occupation for childs
TransientOnTop                60   # percentage to overlap parent
#AutoFocusToTransients              # autofocus for transients
AutoOccupy                         # change occupation automatically
#NoRaiseOnWarp                     # when should I raise a win?
#NoRaiseOnMove                     # when should I raise a win?
#NoRaiseOnResize                   # when should I raise a win?
#DontMoveOff                       # don't move off the screen
MoveOffResistance            150   # threshold for dontmoveoff
IgnoreLockModifier                 # no lock for keybindings
PackNewWindows                     # try to not overlap windows
RaiseWhenAutoUnSqueeze             # raise window if autounsqueeze
AutoRelativeResize                 # flexible resizing no need to grab border
DecorateTransients                 # decorate for ex. popups
#AnimationSpeed                7   # speed for anim. settings
RandomPlacement              "off" # don't ask where to place windows
MovePackResistance             4   # Snap trashold
UsePPosition                  "on" # don't let app decide..
ShortAllWindowsMenus               # don't show IM and WSM in taskmenu
XorValue                     254   # coloring when not using opaque
Zoom                               # show iconification
NoGrabServer                       # no grab server on popup/opaque 
#NoRaiseOnDeiconify                # don't raise on deiconify
#NoRaiseOnMove                     # don't raise window if moved
#NoRaiseOnResize                   # don't raise window if resized
#OpaqueMove                         # show contents at move
#OpaqueResize                       # show contents at resize
ConstrainedMoveTime           300

WindowRing 
WarpRingOnScreen

"Tab" = meta : all : f.warpring "prev"
"Right" = control : all: f.warpring "next" 

################################################
#---------------------> 3D <-------------------#
################################################

#UseThreeDBorders 
#UseThreeDTitles
#UseThreeDIconManager
UseThreeDMenus
#ThreeDBorderWidth 1
#TitleShadowDepth 1
#TitleButtonShadowDepth 1

################################################
#-------------> set workspacemanager <---------#
################################################

WorkSpaceManagerGeometry "380x44-0-0" 6          # place workspacemanager (WSM)
#ReallyMoveInWorkspaceManager                    # really move windows in WSM?
#AlwaysShowWindowWhenMovingFromWorkspaceManager  # see moving window in current
DontWarpCursorInWMap              # don't move to activated window (map click)
#NoShowOccupyAll                  # don't show occupied all windows in WSM
StartInMapState                   # show maps (not buttons) at startup
DontToggleWorkSpaceManagerState   # don't toggle away from map state
#AlwaysShowWindowWhenMovingFromWorkspaceManager # show window in current workspace
DontPaintRootWindow               # don't repaint anything over my wallpaper plz.
ShowWorkspaceManager              # finally.. display that thing

WorkSpaces
{
  "1" {"#102040" "slategray3" "#3184ff" "slategray3"}
  "2" {"#1a3c82" "slategray3" "#35a7ff" "slategray3"}
  "3" {"#1e4dae" "slategray3" "#329aff" "slategray3"}
  "4" {"#1a3f8a" "slategray3" "#3080ff" "slategray3"}
  "5" {"#1f4fb2" "slategray3" "#38a0ff" "slategray3"}
  "6" {"#235cd2" "slategray3" "#34a0ff" "slategray3"}
}

################################################
#---------------> set iconmanager <------------#
################################################

IconManagerGeometry "800x22+0-0" 15 # place iconmanager (IM)
ShowIconManager                   # display IM
ForceIcons                        # don't use app. icon
IconifyByUnmapping                # no icon if iconified
SchrinkIconTitles                  # shrink icon titles (motif way)
#IconDirectory                 "" # directory for icon pix
IconJustification          "left" # where put image/title?
IconRegionJustification    "left" #
IconBorderWidth               0  # frame around I?
#UnknownIcon                   "" # bitmap to use for unknown?

#Icons
#{
#   "st"        "xpm:terminal2.xpm"
#}

################################################
#---------------> set windowbox <--------------#
################################################
#WindowBox "topbox" "478x64+0+0" {
#  "wmcube"
#  "xclock"
#  "xload"
#}
# don't need an ugly box ;D
# .xsession:
# 

################################################
#------------------> set menu <----------------#
################################################

StayUpMenus                      # menu stays open
NoMenuShadows                    # don't use menu shadows
WarpToDefaultMenuEntry           # go to [*] marked menu entry

################################################
#----------------> set borders <---------------#
################################################

FramePadding            0        # frame around titlebar?
BorderWidth             1        # general border with (around windows)
#ClientBorderWidth               # allow clients to use own borderwidth
ConstrainedMoveTime     0
#DecorateTransients
MaxWindowSize       "3360x2100"  # max window size (default: "30000x30000")

################################################
#------------------> set colors <--------------#
################################################

Color
{
    BorderColor           "slategray3" { "irssi" "yellow" "mutt" "red" "slrn" "green" "vim" "blue" }
    BorderTileForeground  "slategray4"
    BorderTileBackground  "Slategray4"
  {
      "TWM Icon Manager"  "DarkSlateGray"
      "WorkSpaceManager"  "slategray3"
  }
    TitleBackground       "#142750"
    TitleForeground       "slategray4"
    MenuShadowColor       "slategray4"
    MenuBackground        "Ivory"
    MenuForeground        "slategray4"
    MenuTitleBackground   "#102040"
    MenuTitleForeground   "Ivory"
    IconManagerBackground "#102040"
    IconManagerForeground "#2f7cff"
}

Monochrome
{
  IconManagerHighlight    "ivory4"
  IconManagerForeground   "ivory4"
  IconManagerBackground   "blue4"
  BorderColor             "black"
  TitleForeground         "black"
  TitleBackground         "white"
  MenuForeground          "white"
  MenuBackground          "black"
  MenuTitleForeground     "white"
  MenuTitleBackground     "black"
  IconForeground          "white"
  IconBackground          "black"
  IconBorderColor         "#388dff"
}

################################################
#------------------> set cursor <--------------#
################################################

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

################################################
#----------> program specific behavior <-------#
################################################

Occupy 
{
#  "gimp"      {"6"}
#  "blender"   {"5"}
#  "amule"     {"4"}
}

WindowGeometries
{
  "st"  "1000x880+200+100"
  "firefox"  "1000x880+200+100"
}

#AutoLower
#{
#}

IconMenuDontShow
{
"xosview"
"wmnet"
}

IconManagerDontShow
{
"wmnet"
"swisswatch"
"xosview"
"xnetload"
"topbox"
"MPlayer"
"ae_clock"
"xclock"
"oclock"
"clock"
"xckmail"
"xbiff"
"xload"
"xeyes"
"perfmeter"
"WorkSpaceManager"
"Twm Door"
}

NoBorder
{
"wmnet"
"MPlayer"
"Gkrellm"
"swisswatch"
"xclock"
"xnetload"
"xosview"
"wmcube"
"topbox"
"xmms"
"bmp"
"beep-media-player"
"TWM Icon Manager"
"WorkSpaceManager"
}

NoTitle
{
"Gkrellm"
"wmnet"
"c_mplayer"
"ding"
"xmms"
"bmp"
"beep-media-player"
"ae_clock"
"xosview"
"MPlayer"
"wmdock"
"xeyes"
"WorkSpaceManager"
"TWM Icon Manager"
}

OccupyAll
{
"wmnet"
"psi"
"xosview"
"xnetload"
"TWM Icon Manager"
}

################################################
#------------> key bindings/functions <--------#
################################################

Function "move-or-lower" { f.move f.deltastop f.lower }
Function "move-or-raise" { f.move f.deltastop f.raise }
Function "move-or-iconify" { f.move f.deltastop f.iconify }
Function "move-or-squeeze" { f.move f.deltastop f.squeeze }

# *** Button = KEYS : CONTEXT : FUNCTION ****

Button1 = : root : f.menu "programs"
Button2 = : root : f.menu "TwmWindows"
Button3 = : root : f.menu "windows"

Button4 = : root : f.leftworkspace
Button5 = : root : f.rightworkspace

Button1 = meta : window : f.move
Button2 = meta : window : f.fullzoom
Button3 = meta : window : f.resize 

Button1 = : title : f.function "move-or-squeeze"
Button2 = : title : f.raiselower
Button3 = : title : f.menu "titlemenu"

Button1 = : frame : f.resize
Button2 = : frame : f.resize
Button3 = : frame : f.resize

Button1 = : icon : f.function "move-or-iconify"
Button2 = : icon : f.iconify

Button1 = : iconmgr : f.iconify
Button2 = : iconmgr : f.iconify

# *** WARP & NAV KEYS ***

"Right" = meta : all : f.rightworkspace
"Left"  = meta : all : f.leftworkspace 
"l"     = meta : all : f.menu "windownavi"
"x"     = mod1 : all : !"xkill &"
"Return" = mod1 : all : !"texec &"
"q"     = mod1 | s : all : f.delete
"q"     = mod1 : all : f.delete
"d"     = mod1 : all : !"dmenu_run -i -l 26 -fn 12x24 -nf yellow -nb black -sf black -sb white &"
"f"     = mod1 | s : all : !"browser &"
"p"     = mod1 | s : all : !"dexec_pass &"
"p"     = mod1 : all : !"dexec_pim &"
"a"     = mod1 : all : !"dexec_apps &"
"d"     = mod1 : all : !"dexec &"
"s"     = mod1 : all : !"dexec_ssh &"
"w"     = mod1 : all : !"dexec_work &"
"f"     = mod1 : all : f.fullzoom


################################################
#----------------> title settings <------------#
################################################

NoTitleHighlight              # don't highlight on focus
TitleJustification "left"     # set title to the center of the titlebar
SqueezeTitle                  # make titlebar smaller than window
MaxIconTitleWidth  15
#AutoSqueeze {
#}

TitleButtonBorderWidth 0
ButtonIndent 0
FramePadding 1
TitlePadding 8
LeftTitleButton "xpm:x_close.xpm" {
  Button1 = : f.deleteordestroy
  Button2 = : f.destroy
  Button3 = : f.menu "windownavi"
}
RightTitleButton "xpm:x_min.xpm" {
  Button1 = : f.iconify
  Button3 = : f.squeeze
}
RightTitleButton "xpm:x_max.xpm" {
  Button1 = : f.fullzoom
  Button3 = : f.squeeze
}
RightTitleButton "xpm:x_vresize.xpm" {
  Button1 = : f.zoom
  Button3 = : f.squeeze
}
RightTitleButton "xpm:x_hresize.xpm" {
  Button1 = : f.hzoom
  Button3 = : f.squeeze
}

################################################
#----------------> mouse behavior <------------#
################################################

BorderResizeCursors           # click on border to resize
#SloppyFocus                   # focus follows mouse
#ClickToFocus
#FocusFollowMouse

################################################
#---------------> menu definitions <-----------#
################################################

menu "programs"
{
"Programs"                                      f.title

"Terminal"              ("Slategray4":"Ivory3") !"st -e ksh &"
"Browser"               ("black":"Ivory3")      !"firefox --new-window &"
"Browser (paste)"       ("black":"Ivory3")      !"firefox --new-window \"$(xclip -o)\" &"
"SAP Logon"             ("black":"Ivory3")      !"ksh -c \"guilogon\" &"
"- bookmarks -"                                 f.title
"Outlook (Mail)"                                !"firefox --new-window https://outlook.office.com/mail/inbox &"
"Outlook (Calendar)"                            !"firefox --new-window https://outlook.office.com/calendar/view/workweek &"
"Bookmarks ->"      ("Slategray4":"Ivory2")     f.menu "bookmarks"
"Documentation ->"  ("Slategray4":"Ivory2")     f.menu "documents"
"- music -"                                     f.title
"Psychedelic Stream"                            !"st -e ksh -c \"mpg123 http://62.210.114.63:8000\" &"
"Progressive Stream"                            !"st -e ksh -c \"mpg123 http://62.210.114.63:8010\" &"
"Drum 'n Bass Stream"                           !"st -e ksh -c \"mpg123 http://62.210.114.63:8030\" &"
"Ambient Stream"                                !"st -e ksh -c \"mpg123 http://62.210.114.63:8060\" &"
"- menus -"                                     f.title
"Edit Config ->"        ("blue3":"Ivory3")      f.menu "edit"
"SSH to ->"             ("blue3":"Ivory3")      f.menu "remotes"
"- notes -"                                     f.title
"Merkzettel"            ("#1a3f8a":"Ivory2")    !"st -e vim ~/.merke.txt &"
"AMQP Documentation"    ("#1a3f8a":"Ivory2")    !"st -e vim ~/AMQP/amqp_devdoc.txt &"
}

menu "documents"
{
  "ABAP Keyword Documentation"  !"firefox --new-window https://help.sap.com/doc/abapdocu_753_index_htm/7.53/de-DE/index.htm &" 
  "ABAP: Programming (BC-ABA)"  !"firefox --new-window https://help.sap.com/viewer/7bfe8cdcfbb040dcb6702dada8c3e2f0/7.5.5/en-US/2ff82a005ddd4f369b74bfda71f297c0.html &"
  "Transaction List"            !"luakit -Un https://codevoid.de/0/p/TXLIST.txt &"
  "Message Server Documentation" !"firefox --new-window https://wiki.wdf.sap.corp/wiki/display/SI/Message+Server+-+Documentation &"
}

menu                    "bookmarks"
{
"Kernel Team"               f.title
"Kernel3 Wiki"              !"firefox --new-window http://kernel3.wdf.sap.corp:1080 &"
"SI Wiki"                   !"firefox --new-window https://wiki.wdf.sap.corp/wiki/display/SI &"
"Glimpse"                   !"firefox --new-window http://imsabap.wdf.sap.corp:1080/cgi-bin/glisrc_cgi.pl?SID=CGK &"
"Jenkins"                   !"firefox --new-window https://kernel3.wdf.sap.corp/jenkins &"
"Review Board"              !"firefox --new-window http://cst:1080/reviewboard &"
"Dashboard"                 !"firefox --new-window http://kernel3.wdf.sap.corp:5000/status/CGK &"
"Coverity Checks"           !"firefox --new-window https://coverity.wdf.sap.corp/reports.htm#v45230/p10026 &"
"Consolidation"             !"firefox --new-window https://p4web.wdf.sap.corp/cgi-bin/list_open_cls.cgi?user=d034266&branch=BAS_CGK &"
"Jira"                      !"firefox --new-window https://sapjira.wdf.sap.corp/secure/IssueHierarchyOverview!default.jspa?projectKey=SRVINF &"
"SAPMAKE"                   !"firefox --new-window http://sapmake.wdf.sap.corp:1080/overview.html?codeline=CGK_MAKE &"
"ABAP System Overview"      !"firefox --new-window https://wiki.wdf.sap.corp/wiki/display/ABAPLangu/Home &"
"ABAP Cloud Platform"       f.title
"SPC PROD (NZA)"            !"firefox --new-window https://spc.ondemand.com &"
"SPC VLAB (VNS)"            !"firefox --new-window https://vns.wdf.sap.corp &"
"Support Tickets"           f.title
"BCP/CSS Ticket System"     !"firefox --new-window https://support.wdf.sap.corp/sap/bc/bsp/sap/crm_ui_start/default.htm?saprole=ZCSSINTPROCE &"
"Support User"              f.title
"CAM Support User (VLAB)"   !"firefox --new-window https://spc-vlab.ondemand.com/sap/bc/webdynpro/a1sspc/cam_sup_central# &"
"CAM Support User (PROD)"   !"firefox --new-window https://spc.ondemand.com/sap/bc/webdynpro/a1sspc/cam_sup_central# &"
"CAM Admin User (VLAB)"     !"firefox --new-window https://spc-vlab.ondemand.com/sap/bc/webdynpro/a1sspc/cam_wd_central?item=reqadmin# &"
"CAM Admin User (PROD)"     !"firefox --new-window https://spc.ondemand.com/sap/bc/webdynpro/a1sspc/cam_wd_central?item=reqadmin# &"
"Reporting"                 f.title
"Bridge"                    !"firefox --new-window https://bridge.mo.sap.corp/#/ &"
"Employee Services"         f.title
"Portal"                    !"firefox --new-window https://portal.wdf.sap.corp/irj/portal &"
"Leave Request"             !"firefox --new-window https://portal.wdf.sap.corp/go/leave-request-de &"
"Computershare"             !"firefox --new-window https://accounts.sap.com/saml2/idp/sso/?sp=computershare &"
"SAP Mall"                  !"firefox --new-window https://portal.wdf.sap.corp/go/de-mall &"
"Admin Services"            f.title
"Linux Attributes"          !"firefox --new-window https://linuxattr.mo.sap.corp &"
"LTS"                       !"firefox --new-window https://lts.wdf.sap.corp &"
"Lunch Menu"                f.title
"Eurest WDF/ROT"            !"firefox --new-window https://fiorilaunchpad.sap.com/sites#lunch-menu&/?catererName=EURESTWDFROT &"
"Feil WDF"                  !"firefox --new-window https://fiorilaunchpad.sap.com/sites#lunch-menu&/?catererName=FEILWDF &"
}

menu "manpages"
{
"Manpages"                                      f.title
"ctwm"                                          !"st -e man ctwm &"
"muttrc"                                        !"st -e man muttrc &"
"kshrc"                                        !"st -e man kshrc &"
}

menu "edit"
{
"Edit Configfile"                               f.title
".ctwmrc"                                       !"st -e vim ~/.ctwmrc &"
".vimrc"                                        !"st -e vim ~/.vim/vimrc &"
".kshrc"                                        !"st -e vim ~/.kshrc &"
}

menu "windownavi"
{
"Window navi"                                   f.title
"i Iconify"                                     f.iconify
"q Close"               ("Red3":"Ivory3")       f.delete
"m Maximize"                                    f.fullzoom
"h Maximize horiz."                             f.hzoom
"j Maximize vert."                              f.zoom
"r Resize"                                      f.resize
"Info"                                          f.identify
"l Lower"                                       f.lower
}

menu "graphics"
{
"Graphics"                                      f.title
"gimp"                                          !"gimp &"
"blender"                                       !"blender &"
"avidemux2"                                     !"avidemux2 &"
}

menu "network"
{
"Network"                                       f.title
"irssi"                                         !"st -e irssi &"
"slrn"                                          !"st -e slrn &"
"muttng"                                        !"st -e muttng &"
"gpa"                                           !"gpa &"
}

menu "tools"
{
"Tools"                                         f.title
"leafpad"                                       !"leafpad &"
"xlock"                                         !"xlock -mode blank &"
}

menu "remotes"
{
"Buildserver"                           f.title
"ld3806 (amd64)"                        !"st -e ksh -c \"ssh -t d034266@ld3806\" &"
"Testframework"                         f.title
"ld2286 (amd64)"                        !"st -e ksh -c \"ssh -t d034266@ld2286\" &"
"fs4435 (SunOS/sparcv9)"                !"st -e ksh -c \"ssh -t d034266@fs4435\" &"
"is0207 (AIX/ppc64)"                    !"st -e ksh -c \"ssh -t d034266@is0207\" &"
"ls3887 (rs6000/ppc64le)"               !"st -e ksh -c \"ssh -t d034266@ls3887\" &"
"hs0180 (hpux/ia64,Testframework)"      !"st -e ksh -c \"ssh -t d034266@hs0180\" &"
"Administration"                        f.title
"ld7972 (amd64,Testframework)"          !"st -e ksh -c \"ssh -t d034266@ld7972\" &"
"cstktest@ld7972 (amd64,Testframework)" !"st -e ksh -c \"ssh -t cstktest@ld7972\" &"
}

Function "showWSMmap"
{
f.showWorkspaceMgr f.setmapstate
}

menu "windows"
{
"Windows"                                       f.title
"Pin menu"              ("black":"Ivory2")      f.pin
""                                              f.separator
"Occupy"                ("black":"Ivory3")      f.occupy
"Occupy All"            ("black":"Ivory3")      f.occupyall
""                                              f.separator
"Button State"          ("black":"Ivory1")      f.setbuttonsstate
"Map State"             ("black":"Ivory1")      f.setmapstate
"ShowWorkSpaceMgr"      ("black":"Ivory1")      f.function "showWSMmap"
"HideWorkSpaceMgr"      ("black":"Ivory1")      f.hideWorkspaceMgr
"Show IconMgr"          ("black":"Ivory1")      f.showiconmgr
"Hide IconMgr"          ("black":"Ivory1")      f.hideiconmgr
 "Iconify"                                      f.iconify
 "Resize"                                       f.resize
 "Move"                                         f.move
 "Raise"                                        f.raise
 "Lower"                                        f.lower
 "Focus"                                        f.focus
 "Unfocus"                                      f.unfocus
""                                              f.separator
"Vanish"                ("black":"Ivory3")      f.vanish
"Kill"                  ("black":"Ivory3")      f.destroy
"Delete"                ("black":"Ivory3")      f.delete
"Refresh"               ("black":"Ivory3")      f.refresh
"Info"                  ("black":"Ivory3")      f.identify
""                                              f.separator
"Restart"               ("Red3":"Ivory3")       f.restart
""                                              f.separator
"Exit X Windows"        ("Black":"Ivory3")      f.menu "exit X"
}

menu "titlemenu"
{
"Window options"                                f.title
"Occupy"                                        f.occupy
"Occupy All"                                    f.occupyall
 "Iconify"                                      f.iconify
 "Resize"                                       f.resize
 "Move"                                         f.move
 "Raise"                                        f.raise
 "Lower"                                        f.lower
 "Focus"                                        f.focus
 "Unfocus"                                      f.unfocus
"Vanish"                                        f.vanish
"Kill"                                          f.destroy
"Delete"                                        f.delete
"Info"                                          f.identify
}

menu "exit X"
{
"Exit X"                                        f.title

"Select if you're SURE!"                        f.quit
}
