xref: /netbsd-src/external/mit/ctwm/etc/system.ctwmrc (revision a8c74629f602faa0ccf8a463757d7baf858bbf3a)
1#
2# $NetBSD: system.ctwmrc,v 1.10 2020/11/16 14:12:46 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
18ShowWorkSpaceManager
19ShowIconManager
20
21# 3D icon managers do not seemingly honor IconManagerHighlight,
22# which makes them slightly less useful
23#UseThreeDIconManagers
24#UseThreeDWMap
25UseThreeDBorders
26#UseThreeDMenus
27UseThreeDTitles
28
29esyscmd(`printf "define(fontsize, %d)\n" "$(/usr/X11R7/libexec/ctwm_font_size)"')
30
31ifelse(fontsize, `64', `
32TitleFont        "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*"
33MenuFont         "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*"
34IconManagerFont  "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*"
35IconFont         "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*"
36ResizeFont       "-*-spleen-*-*-*-*-64-*-*-*-*-*-*-*"
37WorkSpaceFont    "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*"
38WorkSpaceManagerGeometry  "240x960-4-4" 1
39IconManagerGeometry       "800x-1-1+0" 1
40ThreeDBorderWidth         12
41BorderWidth               12
42define(setsizes, `yes')
43')
44
45ifelse(fontsize, `32', `
46TitleFont        "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*"
47MenuFont         "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*"
48IconManagerFont  "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*"
49IconFont         "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*"
50ResizeFont       "-*-spleen-*-*-*-*-32-*-*-*-*-*-*-*"
51WorkSpaceFont    "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*"
52WorkSpaceManagerGeometry  "120x480-4-4" 1
53IconManagerGeometry       "400x-1-1+0" 1
54ThreeDBorderWidth         6
55BorderWidth               6
56define(setsizes, `yes')
57')
58
59ifelse(fontsize, `24', `
60TitleFont        "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*"
61MenuFont         "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*"
62IconManagerFont  "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*"
63IconFont         "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*"
64ResizeFont       "-*-spleen-*-*-*-*-24-*-*-*-*-*-*-*"
65WorkSpaceFont    "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*"
66WorkSpaceManagerGeometry  "90x360-4-4" 1
67IconManagerGeometry       "300x-1-1+0" 1
68ThreeDBorderWidth         4
69BorderWidth               4
70define(setsizes, `yes')
71')
72
73ifelse(fontsize, `12', `
74TitleFont        "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*"
75MenuFont         "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*"
76IconManagerFont  "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*"
77IconFont         "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*"
78ResizeFont       "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*"
79WorkSpaceFont    "-*-spleen-*-*-*-*-8-*-*-*-*-*-*-*"
80WorkSpaceManagerGeometry  "45x180-4-4" 1
81IconManagerGeometry       "150x-1-1+0" 1
82ThreeDBorderWidth         1
83BorderWidth               1
84define(setsizes, `yes')
85')
86
87# Fallback in case a valid font size was not returned.
88# "Default case" is 16px.
89
90ifdef(`setsizes', `', `
91TitleFont        "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*"
92MenuFont         "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*"
93IconManagerFont  "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*"
94IconFont         "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*"
95ResizeFont       "-*-spleen-*-*-*-*-16-*-*-*-*-*-*-*"
96WorkSpaceFont    "-*-spleen-*-*-*-*-12-*-*-*-*-*-*-*"
97WorkSpaceManagerGeometry  "60x240-4-4" 1
98IconManagerGeometry       "200x-1-1+0" 1
99ThreeDBorderWidth         3
100BorderWidth               3
101')
102
103RestartPreviousState
104
105DecorateTransients
106
107# allow the user to have their root window recolored as they choose
108DontPaintRootWindow
109
110# hide window contents while altering windows for performance
111NoOpaqueMove
112NoOpaqueResize
113
114SloppyFocus
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
153NoTitleFocus
154
155# warp through all windows in the current workspace
156WindowRing
157WarpRingOnScreen
158
159NoTitleHighlight
160
161TitleButtonShadowDepth    1
162TitleShadowDepth          1
163TitleButtonBorderWidth    0
164TitlePadding              0
165TitleJustification        "left"
166ButtonIndent              0
167FramePadding		  0
168
169LeftTitleButton           ":xpm:dot"      = f.menu "titleops"
170RightTitleButton          ":xpm:resize"   = f.resize
171RightTitleButton          ":xpm:cross"    = f.delete
172
173BorderShadowDepth         2
174BorderResizeCursors
175
176MaxIconTitleWidth         120
177NoIconManagerFocus
178IconManagerShadowDepth    1
179IconifyByUnmapping
180
181ReallyMoveInWorkspaceManager
182MapWindowCurrentWorkSpace {  "black" "firebrick" }
183DontToggleWorkSpaceManagerState
184DontWarpCursorInWMap
185NoShowOccupyAll
186ReverseCurrentWorkspace
187StartInMapState
188WMgrHorizButtonIndent     0
189WMgrVertButtonIndent      0
190
191WorkSpaces
192{
193    "1"    { "lavender" "black" "darkslateblue" "white" }
194    "2"    { "lavender" "black" "darkslateblue" "white" }
195    "3"    { "lavender" "black" "darkslateblue" "white" }
196    "4"    { "lavender" "black" "darkslateblue" "white" }
197    "5"    { "lavender" "black" "darkslateblue" "white" }
198}
199
200Cursors
201{
202  Frame    "left_ptr"
203  Title    "left_ptr"
204  Icon     "left_ptr"
205  IconMgr  "left_ptr"
206  Move     "fleur"
207  Resize   "fleur"
208  Menu     "left_ptr"
209  Button   "hand2"
210  Wait     "watch"
211  Select   "dot"
212  Destroy  "pirate"
213}
214
215Color
216{
217  BorderColor           "firebrick"
218
219  BorderTileBackground  "steelblue"
220  BorderTileForeground  "steelblue"
221
222  DefaultBackground     "grey70"
223  DefaultForeground     "black"
224
225  TitleBackground       "lavender"
226  TitleForeground       "black"
227
228  MenuBackground        "lavender"
229  MenuForeground        "black"
230  MenuTitleBackground   "darkorange"
231  MenuTitleForeground   "black"
232  MenuShadowColor 	"gray15"
233
234  IconBackground        "black"
235  IconForeground        "white"
236  IconBorderColor       "gray45"
237
238  IconManagerBackground "lavender"
239  IconManagerForeground "black"
240  IconManagerHighlight  "firebrick"
241
242  MapWindowBackground   "lavender"
243  MapWindowForeground   "black"
244}
245
246Monochrome
247{
248    BorderColor 		"black"
249
250    BorderTileForeground 	"black"
251    BorderTileBackground 	"white"
252
253    TitleForeground 		"black"
254    TitleBackground 		"white"
255
256    MenuForeground 		"black"
257    MenuBackground 		"white"
258    MenuTitleForeground 	"black"
259    MenuTitleBackground 	"white"
260
261    MapWindowForeground 	"white"
262    MapWindowBackground 	"white"
263}
264
265menu "NetBSD"
266{
267    "NetBSD"			f.title
268    ""				f.separator
269    " Terminal"			!"uxterm &"
270    " Calculator"		!"xcalc &"
271    " Clock"			!"xclock -digital &"
272    " XEyes"			!"xeyes &"
273    ""				f.separator
274    " Applications"		f.menu "appmenu"
275    ""				f.separator
276    " Restart CTWM"		f.twmrc
277    " Quit"			f.quit
278}
279
280syscmd(/usr/X11R7/libexec/ctwm_app_menu)
281
282menu "titleops"
283{
284    "Window"       f.title
285    ""             f.separator
286    " Iconify"     f.iconify
287    " Resize"      f.resize
288    " Move"        f.move
289    ""             f.separator
290    " Occupy ..."  f.occupy
291    " Occupy All"  f.occupyall
292    ""             f.separator
293    " Raise"       f.raise
294    " Lower"       f.lower
295    ""             f.separator
296    " Zoom"        f.fullzoom
297    " Zoom-V"      f.zoom
298    " Zoom-H"      f.horizoom
299    ""             f.separator
300    " Kill"        f.destroy
301    " Close"       f.delete
302}
303
304IconManagerDontShow
305{
306}
307
308OccupyAll
309{
310   "XClock"
311   "xsm"
312   "xconsole"
313   "XVidCap"
314}
315
316AlwaysOnTop
317{
318   "xclock"
319   "XEyes"
320   "XVidCap"
321}
322
323NoTitle
324{
325   "TWM Icon Manager"
326   "WorkSpaceManager"
327}
328
329WindowRingExclude
330{
331   "TWM Icon Manager"
332   "WorkSpaceManager"
333   "XClock"
334   "xsm"
335   "xconsole"
336}
337
338StartIconified
339{
340}
341
342NoBorder
343{
344   "TWM Icon Manager"
345}
346
347Function "raise-move"          { f.raise f.deltastop f.forcemove }
348Function "raise-and-resize"    { f.raise f.deltastop f.resize }
349
350# These are basically essential for basic functionality.
351
352Button1 =	: title		: f.function "raise-move"
353Button2 =	: title		: f.function "raise-and-resize"
354Button3 =	: title | frame	: f.menu "titleops"
355
356Button1 =	: frame		: f.function "raise-and-resize"
357
358Button1 =	: icon | iconmgr	: f.iconify
359Button2 =	: icon			: f.move
360Button3 =	: icon | iconmgr	: f.raiselower
361
362Button1 =	: root		: f.menu "NetBSD"
363Button2 =	: root		: f.menu "TwmAllWindows"
364Button3 =	: root		: f.menu "NetBSD"
365
366#
367# Mod1 is the "Alt/Meta" key.
368# Mod4 is the "OS" key.
369#
370
371Button1 = mod1	: window	: f.forcemove
372Button1 = mod4	: window	: f.forcemove
373Button3 = mod1	: window 	: f.resize
374Button3 = mod4	: window 	: f.resize
375
376"Up"     = mod4           : all : f.upworkspace
377"Down"   = mod4           : all : f.downworkspace
378"Left"   = mod4           : all : f.prevworkspace
379"Right"  = mod4           : all : f.nextworkspace
380
381"Up"     = mod1 | control : all : f.upworkspace
382"Down"   = mod1 | control : all : f.downworkspace
383"Left"   = mod1 | control : all : f.prevworkspace
384"Right"  = mod1 | control : all : f.nextworkspace
385
386"1"      = mod1 | control : all : f.gotoworkspace "1"
387"2"      = mod1 | control : all : f.gotoworkspace "2"
388"3"      = mod1 | control : all : f.gotoworkspace "3"
389"4"      = mod1 | control : all : f.gotoworkspace "4"
390"5"      = mod1 | control : all : f.gotoworkspace "5"
391"6"      = mod1 | control : all : f.gotoworkspace "6"
392"7"      = mod1 | control : all : f.gotoworkspace "7"
393"8"      = mod1 | control : all : f.gotoworkspace "8"
394"9"      = mod1 | control : all : f.gotoworkspace "9"
395
396"1"      = mod4 : all : f.gotoworkspace "1"
397"2"      = mod4 : all : f.gotoworkspace "2"
398"3"      = mod4 : all : f.gotoworkspace "3"
399"4"      = mod4 : all : f.gotoworkspace "4"
400"5"      = mod4 : all : f.gotoworkspace "5"
401"6"      = mod4 : all : f.gotoworkspace "6"
402"7"      = mod4 : all : f.gotoworkspace "7"
403"8"      = mod4 : all : f.gotoworkspace "8"
404"9"      = mod4 : all : f.gotoworkspace "9"
405
406"XF86AudioRaiseVolume" = : all : !"mixerctl -w outputs.master+=5"
407"XF86AudioLowerVolume" = : all : !"mixerctl -w outputs.master-=5"
408#"XF86AudioMute"        = : all : !"mixerctl -w outputs.master=0"
409
410#
411# "Windows" style keyboard shortcuts
412#
413
414"Tab"    = mod1           : all : f.warpring "next"
415"Tab"    = mod1 | s       : all : f.warpring "prev"
416"Tab"    = mod4           : all : f.warpring "next"
417"Tab"    = mod4 | s       : all : f.warpring "prev"
418"space"  = mod1           : window : f.menu "titleops"
419"F4"     = mod1           : window : f.delete
420
421#
422# "Mac" style keyboard shortcuts
423#
424
425"w"      = mod4           : window : f.delete
426"m"      = mod4           : window : f.iconify
427
428#
429# "evilwm" style keyboard shortcuts
430#
431
432# it is useful to be able to spawn a terminal without clicking.
433"Return" = mod1 | c : all : !"uxterm &"
434"Return" = mod4 | s : all : !"uxterm &"
435
436"slash"  = mod1 | c : all : f.menu "TwmAllWindows"
437"slash"  = mod4 : all     : f.menu "TwmAllWindows"
438"p"      = mod1 | c : all : f.menu "NetBSD"
439"p"      = mod4 : all     : f.menu "NetBSD"
440
441# vi-style directions
442"j"      = mod1 | control : window : f.jumpdown "10"
443"k"      = mod1 | control : window : f.jumpup "10"
444"h"      = mod1 | control : window : f.jumpleft "10"
445"l"      = mod1 | control : window : f.jumpright "10"
446
447"j"      = mod4 : window : f.jumpdown "10"
448"k"      = mod4 : window : f.jumpup "10"
449"h"      = mod4 : window : f.jumpleft "10"
450"l"      = mod4 : window : f.jumpright "10"
451
452"j"      = mod4 | s : window : f.changesize "bottom +10"
453"k"      = mod4 | s : window : f.changesize "bottom -10"
454"h"      = mod4 | s : window : f.changesize "right -10"
455"l"      = mod4 | s : window : f.changesize "right +10"
456
457"j"      = mod1 | c | s : window : f.changesize "bottom +10"
458"k"      = mod1 | c | s : window : f.changesize "bottom -10"
459"h"      = mod1 | c | s : window : f.changesize "right -10"
460"l"      = mod1 | c | s : window : f.changesize "right +10"
461