aboutsummaryrefslogtreecommitdiff
path: root/doc/asciidoc/fluxbox-keys.txt
blob: 4d92c43923397c8af86d62266ebe73d1e52a4602 (plain)
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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
fluxbox-keys(5)
===============
Jim Ramsay <i.am@jimramsay.com>
v1.3.5, 13 February 2013
:man source:   fluxbox-keys.txt
:man version:  {revision}
:man manual:   Fluxbox Manual

NAME
----
fluxbox-keys - keyboard shortcuts configuration for fluxbox(1)

SYNOPSIS
--------
~/.fluxbox/keys

SYNTAX
------
Variable parameters are shown in emphasis: 'argument'

Optional parameters are shown in square brackets: ['argument']

All other characters shown are required verbatim. Whitespace is required
where shown, but it is fine to add more whitespace.

DESCRIPTION
-----------
The keys file defines the keyboard shortcuts for 'fluxbox(1)'.

You can customize fluxbox's key handling through the ~/.fluxbox/keys file. The
file consists of lines of the basic format:

*['modifiers'] 'key' :'command' ['arguments' '...']*

The space between the 'key' and the *:* before the 'command' is mandatory.

All modifiers and commands are case-insensitive. Some command arguments
(especially those that will be passed to the shell) are case-sensitive. Some
key names are case-sensitive.

Lines beginning with a '#' or '!' are considered comments and are unread by
fluxbox.

You will need to ``reload'' fluxbox after editing the keys file so it picks up
your change.

MODIFIERS
---------
You can get a list of possible modifiers by calling `xmodmap -pm'. This also
shows you to which keys the modifiers are mapped, but the following modifiers
are most commonly used:

*Shift Control Mod1 Mod4*

where *Mod1* is the Alt key on the PC keyboard and *Mod4* is usually a key
branded with a familiar company logo.

There are also some special modifiers that refer to mouse button events:::
*OnDesktop*;;
	The mouse cursor is over the desktop (root window), and not any
	window.
*OnToolbar*;;
	The mouse cursor is over the toolbar (which is normally at the bottom
	of the screen).
*OnWindow*;;
	The mouse cursor is over a window.
*OnTitlebar*;;
	The mouse cursor is over a window's titlebar.
*OnTab*;;
	The mouse cursor is over a tab.
*Double*;;
	Limits this action to double-clicks only.

Combining Modifiers
~~~~~~~~~~~~~~~~~~~
To combine two or more modifiers, just list them (space-delimited) in any
order.

KEYS
----
You may specify a key by its key name (for example, *a* or *space*) or by its
numeric keycode (for example, *38* or *0xf3*).

If you don't know the name of a key, you can run *xev(1)* in a terminal, push
the key, and see the name in the output. If you have some "special" keys that
do not produce a key name in the output of *xev(1)*, you can just use the
keycode (NOT the keysym!) in your keys file.

Commands can also be bound to mouse events ('N' denotes the number of the
button, eg. '1' is the primary button, '4'/'5' are the wheel buttons):

*MouseN*;;
	The mouse button 'N' is pressed down and held.
*ClickN*;;
	The mouse button 'N' is clicked (pressed and released with no
	movement in between)
*MoveN*;;
	The mouse button 'N' is currently held, the bound action is triggered
	as often as the mouse moves.


There are some special "keys" that let you bind events to non-keyboard events:

*ChangeWorkspace*;;
	Fires when the workspace changes. This can be used to change backgrounds or
	do anything else you like when you switch to a new workspace. See the
	*EXAMPLES* below for one idea.

WARNING: Use caution with this event! For example, do NOT bind this to any
action that changes your current workspace. If you break your fluxbox with this
feature, you get to keep the pieces.

////////////////
TODO: Advanced users only?
*FocusIn* / *FocusOut*;;
	Fires when the focus is given to or removed from a window. It may be
	useful to combine this with the 'If' command, in the section *Special
	Commands* below.
*MouseOver* / *MouseOut*;;
	Fires when the mouse cursor enters or leaves a specific area of the
	screen. It may be useful to combine this with the 'On*' modifiers
	detailed above and/or the 'If' command.
////////////////

CHAINING
--------
Key bindings can be chained in a fashion similar to Emacs key bindings using the
syntax:

'modifiers-1' 'key-1' 'modifiers-2' 'key-2' :'command' ['arguments ...']*

To abort a chained command part-way through typing it, press the <ESC> key.

.To Bind CTRL+C CTRL+X (Which means, press CTRL+C then CTRL+X) to quit fluxbox
........
Control c Control x :Quit
........

KEYMODES
--------
A specific set of key mappings can be activated and de-activated on-the-fly
using what are called keymodes. The syntax to define a mapping in a keymode
is:

*'keymode': 'modifiers' 'key' :'command' ['arguments' '...']*

Where 'keymode' is any alpha-numeric string name.

When this keymode is activated (see the *KeyMode* command below), all bindings
prefaced by that keymode name become active (and all other keybindings will be
deactivated) until the keymode changes again.

COMMANDS
--------
Some commands have multiple names which are shown below as:::
	CMD1 | CMD2

Related commands have been grouped below as:::
	CMD1 / CMD2

The commands are broken up into sections as follows:::
- Mouse Commands
- Window Commands
- Workspace Commands
- Menu Commands
- Window Manager Commands
- Special Commands

Mouse Commands
~~~~~~~~~~~~~~
These commands may only be bound to mouse buttons (plus modifiers), not
keystrokes. In all cases, the action finishes when the mouse button is
released.

*StartMoving*::
	Start dragging to move the window.

*StartResizing* ['corner']::
Start dragging to resize the window as if you had grabbed the window
at the specified 'corner'.
+
By default 'corner' is *BottomRight*, but may be overridden with one of:;;
*NearestCorner NearestEdge NearestCornerOrEdge Center TopLeft Top TopRight
Left Right BottomLeft Bottom BottomRight*

+
If *NearestCornerOrEdge* is specified the size of the corner can also be
specified to be the larger of one or two following numbers: ['pixel-size'
['percent-size']] or 'percent-size'%, where 'percent-size' is the
percentage of half the window width or height.  If no size is given, it
defaults to 50 pixels and 30%.


*StartTabbing*::
	Start dragging to add this window to another's tabgroup.

*ActivateTab*::
	Activates the tab underneath the mouse.

Window Commands
~~~~~~~~~~~~~~~
These commands ordinarily affect only the currently focused window. The
*OnWindow* modifier and *ForEach* command may affect the window that is used.

*Minimize* | *MinimizeWindow* | *Iconify*::
	Minimize the current window, equivalent to the window button.

*Maximize* | *MaximizeWindow*::
	Maximize the current window, equivalent to the window button.

*MaximizeHorizontal* / *MaximizeVertical*::
	Maximize the current window in one direction only, leaving the other
	dimension unchanged.

*Fullscreen*::
	Resize the window's content to fit the whole screen, without
	any window decoration.

*Raise* / *Lower*::
	Reorder this window to the top or bottom of the window stack, within
	its current layer. See 'fluxbox(1)' for a discussion of layers.

*RaiseLayer* / *LowerLayer* ['offset']::
	Raise the window up to the layer above, or lower it to the layer
	below. See 'fluxbox(1)' for a discussion of layers.

*SetLayer* 'layer'::
	Move the window to the specified layer. 'layer' should be one of
	*AboveDock*, *Dock*, *Top*, *Normal*, *Bottom*, *Desktop*. See
	'fluxbox(1)' for a discussion of layers.

*Close*::
	Close the current window, equivalent to the window button.

*Kill* | *KillWindow*::
	Close a window that's not responding to *Close*, like using *xkill(1)*.

*Shade* | *ShadeWindow*::
	Toggle the *shaded* state of the current window, equivalent to the
	window button. A *shaded* window appears as only the title bar.

*ShadeOn* / *ShadeOff*::
	Set the *shaded* state of the window to On / Off.

*Stick* | *StickWindow*::
	Toggle the *sticky* state of the current window, equivalent to the
	window button. A *sticky* window is visible on all workspaces.

*SetDecor* 'decor'::
	Sets which window decorations will be shown. 'decor' has the same format
	as the `[Deco]' parameter in the apps file. See 'fluxbox-apps(5)' for more info.

*ToggleDecor*::
	Toggles the presence of the window decorations (title bar, window
	buttons, and resize bar).

*NextTab* / *PrevTab*::
	Cycle to the next / previous tab in the current tab group.

*Tab* 'number'::
	Cycle to the given tab in the current tab group, where *1* is the
	first tab. A negative 'number' counts from the end of the tab group
	(*-1* is the last tab, *-2* is the next-to-last, etc.).

*MoveTabRight* / *MoveTabLeft*::
	Reorder the tabs in the current tab group, swapping the current tab
	with the one to the right / left.

*DetachClient*::
	Remove the current tab from the tab group, placing it in its own window.

*ResizeTo* 'width[%]' 'height[%]'::
	Resizes the window to the given width and height. If the value is given in
	percent, then the window size will be based on the current screen's size.

*Resize* 'delta-width[%]' 'delta-height[%]'::
	Resizes the window relative to the current width and height. If the value
	is given in percent, then the window size will be based on the current
	window's size.

*ResizeHorizontal* 'delta-width[%]' / *ResizeVertical* 'delta-height[%]'::
	Resizes the window in one dimension only. If the value is given in
	percent, then the window size will be based on the current window's size.

*MoveTo* 'x[%]' 'y[%]' ['anchor']::
Moves the window to the given coordinates, given in pixels or relatively to
the current screen size if % is specified after the value.
+
If either 'x' or 'y' is set to *\**, that coordinate will be ignored, and the
movement will only take place in one dimension.
+
The default 'anchor' is the upper left corner, but this may be overridden with one of:;;
*TopLeft Left BottomLeft Top Center Bottom TopRight Right BottomRight*

*Move* 'delta-x' 'delta-y'::
	Moves the window relative to its current position. Positive numbers
	refer to right and down, and negative to left and up, respectively.

*MoveRight* 'd' / *MoveLeft* 'd' / *MoveUp* 'd' / *MoveDown* 'd'::
	Moves the window relative to its current position by the number of
	pixels specified in 'd'. If the number is negative, it moves in the
	opposite direction.

*TakeToWorkspace* 'workspace' / *SendToWorkspace* 'workspace'::
	Sends you along with the current window to the selected workspace.
	SendToWorkspace just sends the window. The first workspace is number
	*1*, not 0.

*TakeToNextWorkspace* ['offset'] / *TakeToPrevWorkspace* ['offset']::
	Sends you along with the current window to the next or previous
	workspace. If you set 'offset' to a value greater than the default of
	*1*, it will move you that number of workspaces ahead or behind. If
	you go beyond the end of the currently defined workspaces, it will
	wrap around to the other end automatically.

*SendToNextWorkspace* ['offset'] / *SendToPrevWorkspace* ['offset']::
	Identical to the "TakeTo..." commands, but again this sends only the
	window, and does not move you away from your current workspace.

*SetAlpha* ['alpha' ['unfocused-alpha']]::
Sets the alpha value of a window.
+
Putting a *+* or *-* in front of
the value adds or subtracts from the current value. A plain integer
sets the value explicitly.
+
no arguments;;
	Resets both focused and unfocused settings to default opacity.
one argument;;
	Changes both focused and unfocused alpha settings.
two arguments;;
	First value becomes the focused alpha, second becomes the unfocused
	alpha value.

*SetHead* 'number'::
	Moves the window to the given display head. Only available when fluxbox
	has been compiled with Xinerama support.

*SendToNextHead* ['offset'] / *SendToPrevHead* ['offset']::
	Sends the current window to the next/previous display head. If you
	specify an 'offset' greater than *1*, it will move the window that many
	heads. If this takes the window beyond the total number of heads, it
	will wrap around to the beginning.

*SetXProp* 'PROP=value'::
	Sets the xproperty 'PROP' of the current window to 'value'. Delete the
	content of 'PROP' by using 'PROP='.

Workspace Commands
~~~~~~~~~~~~~~~~~~
These commands affect the entire workspace (or "desktop" as it is sometimes
called).

*AddWorkspace* / *RemoveLastWorkspace*::
	Adds or removes a workspace from the end of the list of workspaces.

*NextWorkspace* ['n'] / *PrevWorkspace* ['n'] / *RightWorkspace* ['n'] / *LeftWorkspace* ['n']::
	Switch to the Next / Previous workspace. All versions accept an
	offset value 'n', which defaults to *1* and refers to the number of
	workspaces to move at one time. {Next,Prev}Workspace wrap around when
	going past the last workspace, whereas {Right,Left}Workspace do not.

*Workspace* 'number'::
	Jumps to the given workspace 'number'. The first workspace is *1*.

*NextWindow* [{'options'}] ['pattern'] / *PrevWindow* [{'options'}] ['pattern']::
Focuses the next / previous window in the focus list.
+
'options' is one or more of the following, space delimited:;;
+
--
	*static*;;
		Instead of moving in order of most-recent focus, move in
		order of when the window was opened (or, the order shown in
		the iconbar).
	*groups*;;
		Only include the current tab in windows with multiple tabs.
--
+
If 'pattern' arguments are supplied, only windows that match all the
patterns are considered - all others are skipped. See the section *CLIENT
PATTERNS* below for more information.
+
This pair of commands has a special side-effect when the keybinding used has a
modifier - It will temporarily raise the cycled window to the front so you can
see it, but if you continue holding down the modifier and press the key again
(For example, keep holding "Alt" while you tap the "Tab" key a few times),
fluxbox will lower the window again when you move on to the next one. This
allows you to preview the windows in order, but does not change the order in
doing so.

*NextGroup* [{'options'}] ['pattern'] / *PrevGroup* [{'options'}] ['pattern']::
	Equivalent to NextWindow / PrevWindow above, but with the *groups*
	option forced on.

*GotoWindow* 'number' [{'options'}] ['pattern']::
	Focuses and activates the window at position 'number' in the focus
	list. The 'options' and 'pattern' arguments have the same meaning as
	*NextWindow* above.

*Activate* ['pattern'] | *Focus* ['pattern']::
	With 'pattern', this is an alias for *GoToWindow* 1 'pattern'. Without,
	this behaves like a window command, so that OnWindow events can change
	the focused window.

*Attach* 'pattern'::
	Combines all windows that match the 'pattern' into a single tab group.
	See *CLIENT PATTERNS* for more about the 'pattern' arguments.

*FocusLeft* / *FocusRight* / *FocusUp* / *FocusDown*::
	Focus to the next window which is located in the direction specified.

*ArrangeWindows* 'pattern' / *ArrangeWindowsVertical* 'pattern' / *ArrangeWindowsHorizontal* 'pattern'::
	Tries to arrange all windows on the current workspace so that they overlap the
	least amount possible. *ArrangeWindowsVertical* prefers vertical splits
	(windows side by side), whereas *ArrangeWindowsHorizontal* prefers horizontal
	splits (windows on top of eachother). See *CLIENT PATTERNS* for more about the
	'pattern' arguments.

*ArrangeWindowsStackLeft* 'pattern' / *ArrangeWindowsStackRight* 'pattern'::
  Similar to *ArrangeWindows*, these commands arrange windows on the current
  workspace. The currently focussed window is used as the 'main' window, and
  will fill half the screen, while the other windows are tiled on the
  other half of the screen as if they were tiled with ArrangeWindows.
  *ArrangeWindowsStackLeft* puts the main window on the RIGHT hand side of the
  screen, and the tiled windows are on the LEFT hand side of the screen.
  *ArrangeWindowsStackRight* puts the main window on the LEFT hand side of the
  screen, and the tiled windows are on the RIGHT hand side of the screen.

*ArrangeWindowsStackTop* 'pattern' / *ArrangeWindowsStackBottom 'pattern'::
  Behaves just like *ArrangeWindowsStackLeft* and *ArrangeWindowsStackRight*.
  *ArrangeWindowsStackBottom* places the main window on the TOP half of the
  screen, and the tiled windows on the bottom half of the screen.
  *ArrangeWindowsStackTop* places the main window on the BOTTOM half of the
  screen and the tiled windows on the top half of the screen.

*ShowDesktop*::
	Minimizes all windows on the current workspace. If they are already all
	minimized, then it restores them.

*Deiconify* 'mode' 'destination'::
Deiconifies windows (or, restores from a minimized state).
+
Where 'mode' may be one of:;;
+
--
	*All*;;
		All icons across all workspaces.
	*AllWorkspace*;;
		All icons on the current workspace.
	*Last*;;
		The last icon across all workspaces.
	*LastWorkspace* (default);;
		The last icon on the current workspace.

--
+
And 'destination' may be one of:;;
+
--
	*Current* (default);;
		Deiconify to the current workspace.
//////
	TODO: Leave this out until it is stable!
	*Origin*;;
		Deiconify to the window's original workspace, and moves you
		there.... sometimes?
//////
	*OriginQuiet*;;
		Deiconify to the window's original workspace, but does so in
		the background, without moving you there.
--

*SetWorkspaceName* 'name' / *SetWorkspaceNameDialog*::
	Sets the name of the current workspace.

*CloseAllWindows*::
	Closes all windows on all desktops.

Menu Commands
~~~~~~~~~~~~~
These commands open or close fluxbox popup menus. For more information on
what these menus contain or how to configure them, see 'fluxbox(1)'.

*RootMenu*;;
	Opens the root menu. See *ROOT MENU* in *fluxbox-menu(5)* for details.

*WorkspaceMenu*;;
	Opens a menu showing all workspaces and windows. See *Workspace Menu* in
	*fluxbox(1)* for details.

*WindowMenu*;;
	Opens a menu containing actions for the current window. See *WINDOW MENU* in
	*fluxbox-menu(5)* for details.

*ClientMenu* ['pattern']::
	Opens a menu that contains all windows. If you specify a 'pattern', only
	matching windows will be in the menu. Selecting a window will jump to that
	workspace and raise the window. See *CLIENT PATTERNS* below for more details
	on the 'pattern' argument.

*CustomMenu* 'path'::
	Opens a custom menu file. This 'path' must be a valid menu file in the same
	format as detailed by the *ROOT MENU* section of *fluxbox-menu(5)*.

*HideMenus*::
	Hide all fluxbox popup menus.

Window Manager Commands
~~~~~~~~~~~~~~~~~~~~~~~
These commands affect the Window Manager, or more than one window.

*Restart* ['path']::
	Restarts fluxbox. This does not close any running applications. If
	the optional 'path' is a path to an executable window manager, that
	manager is started in place of fluxbox.

*Quit* | *Exit*::
	Exits fluxbox. This will normally cause X to stop as well and
	terminate all existing applications, returning you to the login
	manager or console.

*Reconfig* | *Reconfigure*::
	Reloads all fluxbox configuration files including the keys file, apps
	file, and init file, if they have changed.

*SetStyle* 'path'::
	Sets the current style to that given in 'path', which must be the full
	path to a fluxbox style.

*ReloadStyle*::
	Reloads only the current style. Useful after editing a style which is
	currently in use.

*ExecCommand* 'args ...' | *Exec* 'args ...' | *Execute* 'args ...'::
	Probably the most-used binding of all. Passes all the arguments to
	your *$SHELL* (or /bin/sh if $SHELL is not set). You can use this to
	launch applications, run shell scripts, etc. Since all arguments are
	passed verbatim to the shell, you can use environment variables,
	pipes, or anything else the shell can do. Note that processes only
	see environment variables that were set before fluxbox started (such
	as in *\~/.fluxbox/startup*), or any that are set via the *Export* or
	*SetEnv* commands, below. See *fluxbox(1)* for more details on the
	*ENVIRONMENT* and *\~/.fluxbox/startup* file.

*CommandDialog*::
	Pops up a dialog box that lets you type in any of these commands
	manually.

*SetEnv* 'name' 'value' | *Export* 'name'='value'::
	Sets an environment variable in Fluxbox. It will be passed to any
	applications spawned by any future ExecCommand commands.

*SetResourceValue* 'resourcename' 'resourcevalue' | *SetResourceValueDialog*::
	Sets a fluxbox resource value, which are normally stored in the init
	file. See 'fluxbox(1)' for more details on available resources and
	allowed values.

Special Commands
~~~~~~~~~~~~~~~~
These commands have special meanings or behaviors.

*MacroCmd* {'command1'} {'command2'} {'command3'} '...'::
	Allows you to execute more than one command with one keybinding. The
	commands will be executed in series. The *{* *}* brackets are
	literally required, as in the following example:

	MacroCmd {MoveTo 0 0} {ResizeTo 1280 800}

*Delay* {'command'} ['microseconds']::
	Delays running 'command' for the given amount of time. If the same
	key binding is activated again, the timer will be restarted.

*ToggleCmd* {'command1'} {'command2'} '...'::
	Alternates between the commands. On the first press of the bound
	key, runs 'command1'. On the next press, runs 'command2'.

*BindKey* 'keybinding'::
	Adds the given 'keybinding' (which must be a valid key binding as
	defined in the DESCRIPTION section above) to your keys file.

*KeyMode* 'keymode' ['return-keybinding']::
	Activates the named 'keymode' (or, all key binding lines prefaced
	with the same 'keymode':) and deactivates all others until the
	'return-keybinding' (by default *Escape*) is pressed. The default
	keymode is named 'default'.

*ForEach* {'command'} [{'condition'}] | *Map* {'command'} [{'condition'}]::
	Runs the given 'command' (normally one from the *Window Commands*
	section above) on each window. If you specify a 'condition' (See
	*Conditions*, below) the action will be limited to matching windows.

*If* {'condition'} {'then-command'} [{'else-command'}] | *Cond*  {'condition'} {'then-command'} [{'else-command'}]::
	If the 'condition' command returns *true*, then run the
	'then-command', otherwise run the optional 'else-command'. See
	*Conditions* below for more information on the 'condition' argument.

Conditions
~~~~~~~~~~
These special commands are used to match windows conditionally. They are
commonly used by the *If* and *ForEach* command.

*Matches* 'pattern'::
Returns *true* if the current window matches the given 'pattern'. See *CLIENT
PATTERNS* below for details on the 'pattern' syntax.
+
If your key binding uses the *OnWindow* modifier, it matches against the window
you clicked, not the currently focused window.
+
To check other windows besides the currently focused one, see the *Every* and
*Some* conditions below.

*Some* 'condition'::
	Returns *true* if any window on any workspace (not just the currently
	focused one) matches the 'condition'.

*Every* 'condition'::
	Returns *true* if every window on every workspace (not just the
	current one) matches the 'condition'.

*Not* 'condition'::
	Returns *true* if 'condition' returns *false*, and vice-versa.

*And* {'condition1'} {'condition2'} [{'condition3'} ...]::
	Returns *true* if and only if all given conditions return *true*.

*Or* {'condition1'} {'condition2'} [{'condition3'} ...]::
	Returns *true* if any of the listed conditions return *true*.

*Xor* {'condition1'} {'condition2'} [{'condition3'} ...]::
	Returns the boolean *xor* of the truth values for all conditions
	listed.


CLIENT PATTERNS
---------------
Many of the more advanced commands take a 'pattern' argument, which allows you
to direct the action at a specific window or set of windows which match the
properties specified in the 'pattern'.

include::client-patterns.txt[]

FILES
-----
*~/.fluxbox/keys*::
	This is the default location for the keybinding definitions.
*/usr/X11R6/include/X11/keysymdef.h*::
	X key names are in this file.
*/usr/X11R6/lib/X11/XKeysymDB*::
	X key names are also in this file.

RESOURCES
---------
*session.keyFile:* 'location'::
      This may be set to override the location of the keybinding definitions.

ENVIRONMENT
-----------
Remember that *ExecCommand* command can take advantage of other environment
variables if they are set before fluxbox is started, or via the *Export* or
*SetEnv* commands. For example, if *$TERM* is set, it could be use like this:

...........................
Mod1 x :ExecCommand $TERM
...........................

For more information about environment variables, see your shell's manual.

EXAMPLES
--------
Here are some interesting and/or useful examples you can do with your keys
file.

..................
# Mod4+drag moves a window
OnWindow Mod4 Mouse1 :StartMoving

# If any xterm windows are open, cycle through them. If none are open, open
# one:
Mod4 t :If {Some Matches (xterm)} {NextWindow (xterm)} {Exec xterm}

# Set a different wallpaper on every workspace:
ChangeWorkspace :Exec fbsetbg ~/.fluxbox/bg$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}').png

# Focusses the next window with it's xproperty 'PROP' set to 'foo'
Mod4 p Mod4 Tab :NextWindow (@PROP=foo)
..................


AUTHORS
-------
- Jim Ramsay <i.am at jimramsay com> (>fluxbox-1.0.0)
- Curt Micol <asenchi at asenchi com> (>fluxbox-0.9.11)
- Tobias Klausmann <klausman at users sourceforge net> (<=fluxbox-0.9.11)
- Grubert <grubert at users sourceforge net> (fluxbox)
- Matthew Hawkins <matt at mh dropbear id au> (blackbox)
- Wilbert Berendsen <wbsoft at xs4all nl> (blackbox)

SEE ALSO
--------
fluxbox(1) xprop(1) xev(1) xkill(1) regex(7)