1# 2# $NetBSD: system.ctwmrc,v 1.20 2024/04/24 10:35:13 nia Exp $ 3# 4# ctwmrc by nia 5# 6# An attempt to strike a usability balance that makes keys and buttons 7# do the thing users of various operating systems expect them to do. 8# 9# Most things should be possible to accomplish with only the keyboard. 10# 11# Also, mostly inoffensive colours (avoiding potentially inaccessible 12# combinations like red-green). 13# 14 15# don't use the default buttons or key bindings, we define our own 16NoDefaults 17 18DontShowWelcomeWindow 19 20ShowWorkSpaceManager 21ShowIconManager 22 23# 3D icon managers do not seemingly honor IconManagerHighlight, 24# which makes them slightly less useful 25#UseThreeDIconManagers 26#UseThreeDWMap 27UseThreeDBorders 28#UseThreeDMenus 29UseThreeDTitles 30 31esyscmd(`printf "define(fontsize, %d)\n" "$(/usr/X11R7/libexec/ctwm_font_size)"') 32 33ifelse(fontsize, `64', ` 34TitleFont "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*" 35MenuFont "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*" 36IconManagerFont "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*" 37IconFont "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*" 38ResizeFont "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*" 39WorkSpaceFont "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*" 40WorkSpaceManagerGeometry "240x960-4-4" 1 41IconManagerGeometry "800x-1-1+0" 1 42ThreeDBorderWidth 12 43BorderWidth 12 44define(setsizes, `yes') 45') 46 47ifelse(fontsize, `32', ` 48TitleFont "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*" 49MenuFont "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*" 50IconManagerFont "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*" 51IconFont "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*" 52ResizeFont "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*" 53WorkSpaceFont "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*" 54WorkSpaceManagerGeometry "120x480-4-4" 1 55IconManagerGeometry "400x-1-1+0" 1 56ThreeDBorderWidth 6 57BorderWidth 6 58define(setsizes, `yes') 59') 60 61ifelse(fontsize, `24', ` 62TitleFont "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*" 63MenuFont "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*" 64IconManagerFont "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*" 65IconFont "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*" 66ResizeFont "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*" 67WorkSpaceFont "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*" 68WorkSpaceManagerGeometry "90x360-4-4" 1 69IconManagerGeometry "300x-1-1+0" 1 70ThreeDBorderWidth 4 71BorderWidth 4 72define(setsizes, `yes') 73') 74 75ifelse(fontsize, `12', ` 76TitleFont "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*" 77MenuFont "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*" 78IconManagerFont "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*" 79IconFont "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*" 80ResizeFont "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*" 81WorkSpaceFont "-*-spleen-*-*-*-*-8-*-*-*-*-*-*-*" 82WorkSpaceManagerGeometry "45x180-4-4" 1 83IconManagerGeometry "150x-1-1+0" 1 84ThreeDBorderWidth 1 85BorderWidth 1 86define(setsizes, `yes') 87') 88 89# Fallback in case a valid font size was not returned. 90# "Default case" is 16px. 91 92ifdef(`setsizes', `', ` 93TitleFont "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*" 94MenuFont "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*" 95IconManagerFont "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*" 96IconFont "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*" 97ResizeFont "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*" 98WorkSpaceFont "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*" 99WorkSpaceManagerGeometry "60x240-4-4" 1 100IconManagerGeometry "200x-1-1+0" 1 101ThreeDBorderWidth 3 102BorderWidth 3 103') 104 105RestartPreviousState 106 107DecorateTransients 108 109# allow the user to have their root window recolored as they choose 110DontPaintRootWindow 111 112# hide window contents while altering windows for performance 113NoOpaqueMove 114NoOpaqueResize 115 116AutoOccupy 117AutoRelativeResize 118 119CenterFeedbackWindow 120 121NoGrabServer 122 123RaiseOnClick 124 125DontMoveOff 126MoveOffResistance 150 127 128ConstrainedMoveTime 0 129 130IgnoreLockModifier 131 132# Not actually that random. 133# Means that windows do not have to be placed by hand with a mouse, 134# which helps if you are using a keyboard only. 135RandomPlacement "on" 136 137MoveDelta 3 138ClearShadowContrast 40 139DarkShadowContrast 60 140MovePackResistance 100 141 142RaiseWhenAutoUnSqueeze 143ShortAllWindowsMenus 144 145#BeNiceToColorMap 146 147NoStackMode 148 149StayUpMenus 150WarpToDefaultMenuEntry 151MenuShadowDepth 1 152 153# warp through all windows in the current workspace 154WindowRing 155WarpRingOnScreen 156 157NoTitleHighlight 158 159TitleButtonShadowDepth 1 160TitleShadowDepth 1 161TitleButtonBorderWidth 0 162TitlePadding 0 163TitleJustification "left" 164ButtonIndent 0 165FramePadding 0 166 167LeftTitleButton ":xpm:dot" = f.menu "titleops" 168RightTitleButton ":xpm:resize" = f.resize 169RightTitleButton ":xpm:cross" = f.delete 170 171BorderShadowDepth 2 172BorderResizeCursors 173 174MaxIconTitleWidth 120 175NoIconManagerFocus 176IconManagerShadowDepth 1 177IconifyByUnmapping 178 179ReallyMoveInWorkspaceManager 180MapWindowCurrentWorkSpace { "black" "firebrick" } 181DontToggleWorkSpaceManagerState 182DontWarpCursorInWMap 183NoShowOccupyAll 184ReverseCurrentWorkspace 185StartInMapState 186WMgrHorizButtonIndent 0 187WMgrVertButtonIndent 0 188 189WorkSpaces 190{ 191 "1" { "lavender" "black" "darkslateblue" "white" } 192 "2" { "lavender" "black" "darkslateblue" "white" } 193 "3" { "lavender" "black" "darkslateblue" "white" } 194 "4" { "lavender" "black" "darkslateblue" "white" } 195 "5" { "lavender" "black" "darkslateblue" "white" } 196} 197 198Cursors 199{ 200 Frame "left_ptr" 201 Title "left_ptr" 202 Icon "left_ptr" 203 IconMgr "left_ptr" 204 Move "fleur" 205 Resize "fleur" 206 Menu "left_ptr" 207 Button "hand2" 208 Wait "watch" 209 Select "dot" 210 Destroy "pirate" 211} 212 213Color 214{ 215 BorderColor "firebrick" 216 217 BorderTileBackground "steelblue" 218 BorderTileForeground "steelblue" 219 220 DefaultBackground "lavender" 221 DefaultForeground "black" 222 223 TitleBackground "lavender" 224 TitleForeground "black" 225 226 MenuBackground "lavender" 227 MenuForeground "black" 228 MenuTitleBackground "darkorange3" 229 MenuTitleForeground "black" 230 MenuShadowColor "gray15" 231 232 IconBackground "lavender" 233 IconForeground "black" 234 IconBorderColor "steelblue" 235 236 IconManagerBackground "lavender" 237 IconManagerForeground "black" 238 IconManagerHighlight "firebrick" 239 240 MapWindowBackground "lavender" 241 MapWindowForeground "black" 242} 243 244Monochrome 245{ 246 BorderColor "black" 247 248 BorderTileForeground "black" 249 BorderTileBackground "white" 250 251 TitleForeground "black" 252 TitleBackground "white" 253 254 MenuForeground "black" 255 MenuBackground "white" 256 MenuTitleForeground "black" 257 MenuTitleBackground "white" 258 259 MapWindowForeground "white" 260 MapWindowBackground "white" 261} 262 263syscmd(/usr/X11R7/libexec/ctwm_app_menu) 264 265menu "appmenu" 266{ 267 "pkgsrc Applications" f.title 268 " Accessories" f.menu "Accessories" 269 " Games" f.menu "Games" 270 " Graphics" f.menu "Graphics" 271 " Internet" f.menu "Internet" 272 " Multimedia" f.menu "Multimedia" 273 " Office" f.menu "Office" 274 " Programming" f.menu "Programming" 275 " System" f.menu "System" 276 " Misc" f.menu "Misc" 277} 278 279menu "deskutils" 280{ 281 "Desktop utilities" f.title 282 " Calculator" !"xcalc &" 283 " Text editor" !"xedit &" 284 "" f.separator 285 " XEyes" !"xeyes &" 286 " OpenGL Gears" !"glxgears &" 287 " Spinning cube" !"ico -sleep 0.016 -obj cube -colors darkorange &" 288 "" f.separator 289 " Compositor (shadows)" !"pkill xcompmgr; xcompmgr -c &" 290 " Compositor (simple)" !"pkill xcompmgr; xcompmgr -n &" 291 "" f.separator 292 " Magnify" !"xmag -source 100x100 &" 293 " Kill window" !"xkill &" 294} 295 296menu "termutils" 297{ 298 "Terminal utilities" f.title 299 "" f.separator 300 " VIsual Editor" !"xterm -class UXTerm -e vi &" 301 " Tetris" !"xterm -class UXTerm -e tetris &" 302 "" f.separator 303 " Audio mixer" !"xterm -class UXTerm -e aiomixer &" 304 "" f.separator 305 " Top processes" !"xterm -class UXTerm -e top &" 306 " I/O stats" !"xterm -class UXTerm -e 'sysstat iostat' &" 307 " Network stats" !"xterm -class UXTerm -e 'sysstat ifstat' &" 308 " Disk usage" !"xterm -class UXTerm -e 'sysstat df' &" 309} 310 311menu "NetBSD" 312{ 313 "NetBSD" f.title 314 "" f.separator 315 " Terminal" !"uxterm &" 316 "" f.separator 317 " Applications" f.menu "appmenu" 318 " Desktop utilities" f.menu "deskutils" 319 " Terminal utilities" f.menu "termutils" 320 "" f.separator 321 " Restart CTWM" f.twmrc 322 " Quit" f.quit 323} 324 325menu "titleops" 326{ 327 "Window" f.title 328 "" f.separator 329 " Iconify" f.iconify 330 " Resize" f.resize 331 " Move" f.move 332 "" f.separator 333 " Occupy ..." f.occupy 334 " Occupy All" f.occupyall 335 "" f.separator 336 " Raise" f.raise 337 " Lower" f.lower 338 "" f.separator 339 " Zoom" f.fullzoom 340 " Zoom-V" f.zoom 341 " Zoom-H" f.horizoom 342 "" f.separator 343 " Kill" f.destroy 344 " Close" f.delete 345} 346 347IconManagerDontShow 348{ 349} 350 351OccupyAll 352{ 353 "XClock" 354 "xsm" 355 "xconsole" 356 "XVidCap" 357} 358 359AlwaysOnTop 360{ 361 "XEyes" 362 "XVidCap" 363} 364 365NoTitle 366{ 367 "TWM Icon Manager" 368 "WorkSpaceManager" 369 "XClock" 370} 371 372WindowRingExclude 373{ 374 "TWM Icon Manager" 375 "WorkSpaceManager" 376 "XClock" 377 "xsm" 378 "xconsole" 379} 380 381StartIconified 382{ 383} 384 385NoBorder 386{ 387} 388 389Function "raise-move" { f.raise f.deltastop f.forcemove } 390Function "raise-and-resize" { f.raise f.deltastop f.resize } 391 392# These are basically essential for basic functionality. 393 394Button1 = : title : f.function "raise-move" 395Button2 = : title : f.function "raise-and-resize" 396Button3 = : title | frame : f.menu "titleops" 397 398Button1 = : frame : f.function "raise-and-resize" 399 400Button1 = : icon | iconmgr : f.iconify 401Button2 = : icon : f.move 402Button3 = : icon | iconmgr : f.raiselower 403 404Button1 = : root : f.menu "NetBSD" 405Button2 = : root : f.menu "TwmAllWindows" 406Button3 = : root : f.menu "NetBSD" 407 408# 409# Mod1 is the "Alt/Meta" key. 410# Mod4 is the "OS" key. 411# 412 413Button1 = mod1 : window : f.forcemove 414Button1 = mod4 : window : f.forcemove 415Button3 = mod1 : window : f.resize 416Button3 = mod4 : window : f.resize 417 418"Up" = mod4 : all : f.upworkspace 419"Down" = mod4 : all : f.downworkspace 420"Left" = mod4 : all : f.prevworkspace 421"Right" = mod4 : all : f.nextworkspace 422 423"Up" = mod1 | control : all : f.upworkspace 424"Down" = mod1 | control : all : f.downworkspace 425"Left" = mod1 | control : all : f.prevworkspace 426"Right" = mod1 | control : all : f.nextworkspace 427 428"1" = mod1 | control : all : f.gotoworkspace "1" 429"2" = mod1 | control : all : f.gotoworkspace "2" 430"3" = mod1 | control : all : f.gotoworkspace "3" 431"4" = mod1 | control : all : f.gotoworkspace "4" 432"5" = mod1 | control : all : f.gotoworkspace "5" 433"6" = mod1 | control : all : f.gotoworkspace "6" 434"7" = mod1 | control : all : f.gotoworkspace "7" 435"8" = mod1 | control : all : f.gotoworkspace "8" 436"9" = mod1 | control : all : f.gotoworkspace "9" 437 438"1" = mod4 : all : f.gotoworkspace "1" 439"2" = mod4 : all : f.gotoworkspace "2" 440"3" = mod4 : all : f.gotoworkspace "3" 441"4" = mod4 : all : f.gotoworkspace "4" 442"5" = mod4 : all : f.gotoworkspace "5" 443"6" = mod4 : all : f.gotoworkspace "6" 444"7" = mod4 : all : f.gotoworkspace "7" 445"8" = mod4 : all : f.gotoworkspace "8" 446"9" = mod4 : all : f.gotoworkspace "9" 447 448"XF86AudioRaiseVolume" = : all : !"mixerctl -w outputs.master+=5" 449"XF86AudioLowerVolume" = : all : !"mixerctl -w outputs.master-=5" 450#"XF86AudioMute" = : all : !"mixerctl -w outputs.master=0" 451 452# 453# "Windows" style keyboard shortcuts 454# 455 456"Tab" = mod1 : all : f.warpring "next" 457"Tab" = mod1 | s : all : f.warpring "prev" 458"Tab" = mod4 : all : f.warpring "next" 459"Tab" = mod4 | s : all : f.warpring "prev" 460"space" = mod1 : window : f.menu "titleops" 461"F4" = mod1 : window : f.delete 462 463# 464# "Mac" style keyboard shortcuts 465# 466 467"w" = mod4 : window : f.delete 468"m" = mod4 : window : f.iconify 469 470# 471# "evilwm" style keyboard shortcuts 472# 473 474# it is useful to be able to spawn a terminal without clicking. 475"Return" = mod1 | c : all : !"uxterm &" 476"Return" = mod4 | s : all : !"uxterm &" 477 478"slash" = mod1 | c : all : f.menu "TwmAllWindows" 479"slash" = mod4 : all : f.menu "TwmAllWindows" 480"p" = mod1 | c : all : f.menu "NetBSD" 481"p" = mod4 : all : f.menu "NetBSD" 482 483# vi-style directions 484"j" = mod1 | control : window : f.jumpdown "10" 485"k" = mod1 | control : window : f.jumpup "10" 486"h" = mod1 | control : window : f.jumpleft "10" 487"l" = mod1 | control : window : f.jumpright "10" 488 489"j" = mod4 : window : f.jumpdown "10" 490"k" = mod4 : window : f.jumpup "10" 491"h" = mod4 : window : f.jumpleft "10" 492"l" = mod4 : window : f.jumpright "10" 493 494"j" = mod4 | s : window : f.changesize "bottom +10" 495"k" = mod4 | s : window : f.changesize "bottom -10" 496"h" = mod4 | s : window : f.changesize "right -10" 497"l" = mod4 | s : window : f.changesize "right +10" 498 499"j" = mod1 | c | s : window : f.changesize "bottom +10" 500"k" = mod1 | c | s : window : f.changesize "bottom -10" 501"h" = mod1 | c | s : window : f.changesize "right -10" 502"l" = mod1 | c | s : window : f.changesize "right +10" 503