-
Notifications
You must be signed in to change notification settings - Fork 1
/
default-ahwmrc.h
executable file
·399 lines (397 loc) · 15.2 KB
/
default-ahwmrc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
/* generated by ./make-xwmrc-include.pl - do not edit */
#ifndef ahwmrc_76213
#define ahwmrc_76213
char *default_ahwmrc[] = {
"# Default AHWM configuration file",
"# This file is created whenever AHWM starts and does not find",
"# a configuration file.",
"# You can use this file as a template to build your own.",
"",
"# the bottom of the file contains a list of selectors, options and",
"# functions for quick reference (search for QUICK REFERENCE)",
"",
"# Comments are shell-script-style,",
"// C++-style",
"/* or C-style */",
"",
"# Keybindings",
"",
"# the modifiers you can use are",
"# control, alt, shift, hyper, super, meta, mod1...mod5",
"# the modifiers are case-insensitive",
"# the non-modifier keys that go with the modifiers can be found",
"# in your /usr/X11R6/include/keysymdef.h file, or by running",
"# the standard X program \"xev\" and typing into the window",
"# the non-modifier keys are CASE-SENSITIVE",
"# (this is the only thing in this file which is case-sensitive)",
"# CapsLock, ScrollLock, etc. are ignored when reading keystrokes.",
"",
"BindKey \"Control | Alt | Shift | t\" Launch(\"xterm\");",
"BindKey \"Control | Alt | Shift | n\" Launch(\"netscape\");",
"BindKey \"Control | Alt | Shift | e\" Launch(\"emacs\");",
"BindKey \"Control | Alt | Shift | f\" Launch(\"xmms -f\");",
"BindKey \"Control | Alt | Shift | z\" Launch(\"xmms -r\");",
"",
"# Argument for Launch() is passed through /bin/sh:",
"",
"BindKey \"Control | Alt | Shift | k\" Launch(\"konqueror > /dev/null 2>&1\");",
"",
"# mutes/unmutes sound in case of phone, door, etc.",
"",
"BindKey \"Control | Alt | Shift | Return\" Launch(\"sound-toggle\");",
"",
"# resets b0rked sound card on my laptop",
"",
"BindKey \"Control | Alt | Shift | space\" Launch(\"xmms -u ; xmms -u\");",
"",
"# strings can contain (some) C-style escape sequences",
"",
"BindKey \"Alt | F4\" Launch(\"xmessage \\\"This isn't windows, fool\\\"\");",
"",
"# can never have too many ways to kill programs",
"# also, this is how to bind to argument-less functions",
"",
"BindKey \"Control | Alt | Shift | x\" Launch(\"xkill\");",
"BindKey \"Control | Alt | Escape\" KillNicely();",
"BindKey \"Control | Alt | Shift | Escape\" KillWithExtremePrejudice();",
"",
"# While moving or resizing, you can use the arrow keys and the keys w,",
"# a, s, d. Use Shift with one of those keys to move to an edge or",
"# resize in larger increments. Hit Enter to accept the move/resize,",
"# hit Escape to cancel it, hit Control to toggle between a move and a",
"# resize, and hit Space during a resize to constrain the direction.",
"",
"BindKey \"Control | Alt | Shift | m\" MoveInteractively();",
"BindKey \"Control | Alt | Shift | r\" ResizeInteractively();",
"",
"# Sun X server doesn't grok this key combination, throws me off",
"",
"BindKey \"Control | Alt | BackSpace\" Quit();",
"",
"# The Restart() function will completely restart AHWM. You",
"# can use this if you change this file while running AHWM,",
"# The process should be completely transparent - all your",
"# windows should remain in the same position and workspace, etc.",
"",
"BindKey \"Control | Alt | Shift | r\" Restart();",
"",
"# The CycleNext() and CyclePrevious() functions simulate an action",
"# similar to that of Microsoft Windows's \"alt-tab\" action: windows",
"# are maintained on a stack and these functions walk up and down",
"# the stack (see the man pages for more details). You will not",
"# be able to use the keyboard for anything else until you let go",
"# of all modifier keys. See also \"CycleBehaviour\".",
"# NB: this function must be bound to a keystroke, not a mouse click.",
"",
"BindKey \"Alt | Tab\" CycleNext();",
"BindKey \"Alt | Shift | Tab\" CyclePrevious();",
"",
"# this is how to bind to functions with one argument",
"",
"BindKey \"Control | Alt | 7\" SendToWorkspace(7);",
"BindKey \"Control | Alt | 6\" SendToWorkspace(6);",
"BindKey \"Control | Alt | 5\" SendToWorkspace(5);",
"BindKey \"Control | Alt | 4\" SendToWorkspace(4);",
"BindKey \"Control | Alt | 3\" SendToWorkspace(3);",
"BindKey \"Control | Alt | 2\" SendToWorkspace(2);",
"BindKey \"Control | Alt | 1\" SendToWorkspace(1);",
"",
"# the 'Quote()' function should be bound to a",
"# key release in order to work correctly",
"# (otherwise the key depress will invoke quote()",
"# and the key release will be quoted).",
"",
"BindKeyRelease \"Control | Alt | Shift | q\" Quote();",
"",
"# Binding to button clicks is similar to binding to keys, but you have",
"# to specify the location for the click. The location is one of",
"# \"Titlebar\" or \"Frame\". You can use the same modifiers as",
"# with BindKey and the buttons are Button1 through Button5:",
"# Button1 = left button, Button2 = middle button, Button3 = right",
"# button, Button4 = wheel up, Button5 = wheel down",
"",
"BindButton Titlebar \"Button3\" Maximize();",
"BindButton Titlebar \"Button2\" KillNicely();",
"BindButton Titlebar \"Control | Button2\" KillWithExtremePrejudice();",
"",
"# We have to bind drags to both Frame and Titlebar in order to",
"# work everywhere in a window - this may be changed sometime in",
"# the future; it's not very intuitive.",
"",
"BindDrag Frame \"Alt | Button1\" MoveInteractively();",
"BindDrag Titlebar \"Alt | Button1\" MoveInteractively();",
"BindDrag Frame \"Alt | Button3\" ResizeInteractively();",
"BindDrag Titlebar \"Alt | Button3\" ResizeInteractively();",
"",
"# Sometimes you may want to bind more than one function",
"# to the same action. To do this, you need to define",
"# your own function and use the \"Invoke()\" function.",
"# Here's an example:",
"",
"Define \"Focus-and-Move\" {",
" Focus();",
" MoveInteractively();",
"}",
"BindDrag Titlebar \"Button1\" Invoke(\"Focus-and-Move\");",
"",
"# I like to have the root background indicate",
"# the current workspace, so I do this:",
"",
"Define \"f1\" {",
" Launch(\"xsetroot -solid \\\"#404040\\\"\");",
" GotoWorkspace(1);",
"}",
"BindKey \"Alt | 1\" Invoke(\"f1\");",
"Define \"f2\" {",
" Launch(\"xsetroot -solid \\\"#2F4F4F\\\"\");",
" GotoWorkspace(2);",
"}",
"BindKey \"Alt | 2\" Invoke(\"f2\");",
"Define \"f3\" {",
" Launch(\"xsetroot -solid \\\"#000050\\\"\");",
" GotoWorkspace(3);",
"}",
"BindKey \"Alt | 3\" Invoke(\"f3\");",
"Define \"f4\" {",
" Launch(\"xsetroot -solid \\\"#500000\\\"\");",
" GotoWorkspace(4);",
"}",
"BindKey \"Alt | 4\" Invoke(\"f4\");",
"Define \"f5\" {",
" Launch(\"xsetroot -solid \\\"#500050\\\"\");",
" GotoWorkspace(5);",
"}",
"BindKey \"Alt | 5\" Invoke(\"f5\");",
"Define \"f6\" {",
" Launch(\"xsetroot -solid \\\"#005000\\\"\");",
" GotoWorkspace(6);",
"}",
"BindKey \"Alt | 6\" Invoke(\"f6\");",
"Define \"f7\" {",
" Launch(\"xsetroot -solid \\\"#101010\\\"\");",
" GotoWorkspace(7);",
"}",
"BindKey \"Alt | 7\" Invoke(\"f7\");",
"",
"# You cannot use the \"Define\" keyword within a context (the",
"# definition will be ignored if you do so).",
"#",
"# Defining recursive functions is allowed, but you should be",
"# very careful if you choose to do so. Consider the following:",
"# ",
"# Define \"foo\" {",
"# Invoke(\"foo\");",
"# }",
"# BindKey \"Alt | r\" Invoke(\"foo\");",
"#",
"# Question: what happens when you press Alt+r?",
"# Answer: \"foo\" will be invoked thousands of times",
"# until you blow the stack and AHWM will segfault.",
"# This is not a bug: if you want to shoot yourself",
"# in the foot, I won't second-guess you.",
"",
"# now set option values",
"# these set the defaults (which may be overridden below)",
"",
"DisplayTitlebar = True;",
"FocusPolicy = SloppyFocus;",
"RaiseDelay = 350;",
"PassFocusClick = True;",
"TitlePosition = DisplayLeft;",
"KeepTransientsOnTop = True;",
"TitlebarFont = \"-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*\";",
"",
"# The height of the titlebar is determined by the font you choose.",
"# If you would like a larger font, I might suggest this one:",
"# TitlebarFont = \"-adobe-times-*-r-*-*-*-180-*-*-*-*-*-*\";",
"",
"# NumberOfWorkspaces is special in that it cannot be put into a",
"# context like all the other options (it only applies globally)",
"",
"NumberOfWorkspaces = 7;",
"",
"# this is how to override defaults",
"",
"IsShaped True {",
" DisplayTitlebar = False;",
"}",
"WindowInstance \"oclock\" {",
" # DisplayTitlebar = False; /* not needed, above applies */",
" FocusPolicy = DontFocus;",
" Omnipresent = True;",
" AlwaysOnTop = True;",
"}",
"WindowClass \"xmms\" {",
" # DisplayTitlebar = False; /* not needed, xmms sets motif hint */",
" FocusPolicy = ClickToFocus;",
"}",
"",
"# XMMS has a plugin which does not set any",
"# hints and does not even set instance/class",
"",
"WindowName \"OpenGL Spectrum analyzer\" {",
" DisplayTitlebar = False;",
" FocusPolicy = DontFocus;",
"}",
"",
"# A somewhat more complex example - workspace 7 usually holds an xmms",
"# invocation, but occasionally will have an xterm. I want xmms focused",
"# almost all of the time.",
"",
"InWorkspace 7 {",
" # Use \"*\" for window name/class/instance to match all windows",
" WindowClass \"*\" {",
" CycleBehaviour = SkipCycle;",
" FocusPolicy = ClickToFocus;",
" DisplayTitlebar = False;",
" }",
" WindowClass \"xmms\" {",
" CycleBehaviour = RaiseImmediately;",
" }",
"}",
"",
"# The above example could be done in a number of ways; for example,",
"# this is equivalent:",
"# InWorkspace 7 {",
"# CycleBehaviour = SkipCycle;",
"# FocusPolicy = ClickToFocus;",
"# WindowClass \"xmms\" {",
"# CycleBehaviour = RaiseImmediately;",
"# }",
"# }",
"",
"# I usually use workspace 1 for most of my editing - emacs's mouse-avoid",
"# mode interacts poorly with sloppy focus and the workspace only holds",
"# two full-screen windows anyway.",
"",
"InWorkspace 1 {",
" FocusPolicy = ClickToFocus;",
"}",
"",
"# I use colors to identify the current workspace at a glance:",
"",
"ColorTitlebarText = \"#D8D8D8\";",
"ColorTitlebarTextFocused = \"#E0E0E0\";",
"InWorkspace 1 {",
" ColorTitlebar = \"#282828\";",
" ColorTitlebarFocused = \"#404040\";",
"}",
"InWorkspace 2 {",
" ColorTitlebar = \"#193939\";",
" ColorTitlebarFocused = \"#2F4F4F\";",
"}",
"InWorkspace 3 {",
" ColorTitlebar = \"#000038\";",
" ColorTitlebarFocused = \"#000050\";",
"}",
"InWorkspace 4 {",
" ColorTitlebar = \"#380000\";",
" ColorTitlebarFocused = \"#500000\";",
"}",
"InWorkspace 5 {",
" ColorTitlebar = \"#380038\";",
" ColorTitlebarFocused = \"#500050\";",
"}",
"InWorkspace 6 {",
" ColorTitlebar = \"#003800\";",
" ColorTitlebarFocused = \"#005000\";",
"}",
"InWorkspace 7 {",
" ColorTitlebar = \"#000000\";",
" ColorTitlebarFocused = \"#101010\";",
"}",
"",
"# All of the options set above may be overridden by the application,",
"# if the application uses hints. For example, \"oclock\" is the only",
"# application that we specifically made omnipresent, but \"kicker\"",
"# (the KDE taskbar) sets a hint which tells AHWM to make \"kicker\"",
"# omnipresent. This hint overrides the default (user-specified)",
"# value of not-omnipresent. To make an option apply regardless",
"# of whatever hints the application sets, you can use \"is!\" instead",
"# of \"=\" when setting the option. The \"is!\" keyword should",
"# be used in very few cases (when you don't like the hint a",
"# specific application sets or you don't like AHWM's interpretation",
"# of a certain hint).",
"#",
"# This makes the KDE taskbar appear in only one workspace.",
"# FIXME: use something else as an example and leave kicker alone",
"",
"WindowInstance \"kicker\" {",
" Omnipresent is! False;",
"}",
"",
"# \"kpager\" (the KDE pager) sets a hint to be Sticky. However,",
"# \"kpager\" does not remember its position or size and will sometimes",
"# start up with an odd position or size. This re-enables moving",
"# and resizing:",
"",
"WindowInstance \"kpager\" {",
" Sticky is! False;",
"}",
"",
"# QUICK REFERENCE",
"# these can also be found in the man page",
"#",
"# Selectors:",
"#",
"# IsShaped (boolean) - is window shaped?",
"# InWorkspace (integer) - is window in workspace n?",
"# WindowName (string) - is window's name s?",
"# WindowClass (string) - is window's Class s?",
"# WindowInstance (string) - is window's Instance s?",
"# Not (context) - invert yes/no status of next context selector",
"# TransientFor (context) - is window transient for next context selector?",
"# HasTransient (context) - does window have a transient",
"# for which next context applies?",
"#",
"# Options:",
"#",
"# AlwaysOnBottom (boolean) - below all other clients?",
"# AlwaysOnTop (boolean) - on top of all other clients?",
"# ColorTitlebar (string) - an X color, ie \"#FF0000\" or \"red\"",
"# ColorTitlebarFocused (string) - titlebar color when window is focused",
"# ColorTitlebarText (string) - color of window's title",
"# ColorTitlebarTextFocused (string) - window title color when focused",
"# CycleBehavior (enumeration) - one of:",
"# { SkipCycle, RaiseImmediately, RaiseOnCycleFinish, DontRaise }",
"# DefaultWorkspace (integer) - use zero for current workspace",
"# DisplayTitlebar (boolean) - add a titlebar?",
"# DontBindMouse (boolean) - do not apply mouse bindings",
"# DontBindKeys (boolean) - do not apply key bindings",
"# FocusPolicy (enumeration) - one of:",
"# { ClickToFocus, SloppyFocus, DontFocus }",
"# KeepTransientsOnTop (boolean) - app's dialogs stay on top of app?",
"# NumberOfWorkspaces (integer) - must be > 0, only global",
"# Omnipresent (boolean) - display in all workspaces?",
"# PassFocusClick (boolean) - pass focusing click for ClickToFocus?",
"# RaiseDelay (integer) - milliseconds before raise with SloppyFocus",
"# Sticky (boolean) - do not allow moving or resizing",
"# TitlebarFont (string) - X font name, only global",
"# TitlePosition (enumeration) - one of:",
"# { DisplayLeft, DisplayRight, DisplayCentered, DontDisplay, }",
"# ",
"#",
"# Functions:",
"#",
"# CycleNext (void) - like Windows' alt-tab",
"# CyclePrevious (void) - like Windows' alt-shift-tab",
"# Focus (void) - use with ClickToFocus, see example above",
"# GotoWorkspace (integer) - make workspace n current workspace",
"# Invoke (string) - please see example",
"# KillNicely (void) - ask window to close itself",
"# KillWithExtremePrejudice (void) - use XKillClient(3)",
"# Launch (string) - pass string to /bin/sh",
"# Maximize (void) - toggle maximization state",
"# MaximizeHorizontally (void) - toggle horizontal maximization state",
"# MaximizeVertically (void) - toggle vertical maximization state",
"# MoveInteractively (void) - move with keyboard/mouse",
"# MoveResize (string) - non-interactive, use X geometry string",
"# Nop (void) - do nothing (but do grab click/keystroke)",
"# Quit (void) - exit ahwm",
"# Quote (void) - please see example above",
"# ResizeInteractively (void) - resize with keyboard/mouse",
"# Restart (void) - restart AHWM, re-reading config file",
"# SendToWorkspace (integer) - send current window to workspace n",
};
#define DEFAULT_AHWMRC_NLINES 390
#endif