]> git.lizzy.rs Git - bspwm.git/blob - doc/bspwm.1.asciidoc
Fix misinterpreted asterisk in rule syntax
[bspwm.git] / doc / bspwm.1.asciidoc
1 :man source:   Bspwm
2 :man version:  {revnumber}
3 :man manual:   Bspwm Manual
4
5 bspwm(1)
6 ========
7
8 Name
9 ----
10
11 bspwm - Binary space partitioning window manager
12
13 Synopsis
14 --------
15
16 *bspwm* [*-h*|*-v*|*-c* 'CONFIG_PATH']
17
18 *bspc* 'DOMAIN' ['SELECTOR'] 'COMMANDS'
19
20 Description
21 -----------
22
23 *bspwm* is a tiling window manager that represents windows as the leaves of a full binary tree.
24
25 It is controlled and configured via *bspc*.
26
27
28 Options
29 -------
30
31 *-h*::
32         Print the synopsis and exit.
33
34 *-v*::
35         Print the version and exit.
36
37 *-c* 'CONFIG_PATH'::
38         Use the given configuration file.
39
40 Common Definitions
41 ------------------
42
43 ----
44 DIR         := north | west | south | east
45 CYCLE_DIR   := next | prev
46 ----
47
48 Selectors
49 ---------
50
51 Selectors are used to select a target node, desktop, or monitor. A selector
52 can either describe the target relatively or name it globally.
53
54 Selectors consist of a descriptor and any number of non-conflicting modifiers
55 as follows:
56
57         DESCRIPTOR(.MODIFIER)*
58
59 An exclamation mark can be prepended to certain modifiers in order to reverse their meaning.
60
61 Node
62 ~~~~
63
64 Select a node.
65
66 ----
67 NODE_SEL := (<node_id>|PATH|DIR|CYCLE_DIR|last|older|newer|biggest|focused)[.[!]focused][.[!]automatic][.[!]local][.[!]leaf][.[!]STATE][.[!]FLAG][.[!]LAYER][.[!]same_class]
68
69 STATE := tiled|pseudo_tiled|floating|fullscreen
70
71 FLAG := urgent|sticky|private|locked
72
73 LAYER := below|normal|above
74
75 PATH := @[DESK_SEL:][[/]JUMP](/JUMP)*
76
77 JUMP := first|1|second|2|brother|parent|DIR
78 ----
79
80 Descriptors
81 ^^^^^^^^^^^
82
83 <node_id>::
84         Selects the node with the given ID.
85
86 'PATH'::
87         Selects the node at the given path.
88
89 'DIR'::
90         Selects the window in the given (spacial) direction relative to the active node.
91
92 'CYCLE_DIR'::
93         Selects the window in the given (cyclic) direction.
94
95 biggest::
96         Selects the biggest window on the current desktop.
97
98 last::
99         Selects the previously focused node.
100
101 focused::
102         Selects the currently focused node.
103
104 older::
105         Selects the node older than the focused node in the history.
106
107 newer::
108         Selects the node newer than the focused node in the history.
109
110 Path Jumps
111 ^^^^^^^^^^
112
113 The initial node is the focused node (or the root if the path starts with '/') of the focused desktop (or the selected desktop if the path has a 'DESK_SEL' prefix).
114
115 1|first::
116         Jumps to the first child.
117
118 2|second::
119         Jumps to the second child.
120
121 brother::
122         Jumps to the brother node.
123
124 parent::
125         Jumps to the parent node.
126
127 'DIR'::
128         Jumps to the node holding the edge in the given direction.
129
130 Modifiers
131 ^^^^^^^^^
132
133 [!]focused::
134         Only consider focused or unfocused nodes.
135
136 [!]automatic::
137         Only consider nodes in automatic or manual insertion mode.
138
139 [!]local::
140         Only consider nodes in or not in the current desktop.
141
142 [!]leaf::
143         Only consider leaves or internal nodes.
144
145 [!](tiled|pseudo_tiled|floating|fullscreen)::
146         Only consider windows in or not in the given state.
147
148 [!]same_class::
149         Only consider windows that have or don't have the same class as the current window.
150
151 [!](private|urgent|sticky|locked)::
152         Only consider windows that have or don't have the given flag set.
153
154 [!](below|normal|above)::
155         Only consider windows in or not in the given layer.
156
157 Desktop
158 ~~~~~~~
159
160 Select a desktop.
161
162 ----
163 DESKTOP_SEL := (<desktop_name>|[MONITOR_SEL:](focused|^<n>)CYCLE_DIR|last|older|newer)[.[!]occupied][.[!]focused][.[!]urgent][.[!]local]
164 ----
165
166 Descriptors
167 ^^^^^^^^^^^
168
169 <desktop_name>::
170         Selects the desktop with the given name.
171
172 ^<n>::
173         Selects the nth desktop.
174
175 'CYCLE_DIR'::
176         Selects the desktop in the given direction relative to the active desktop.
177
178 last::
179         Selects the previously focused desktop.
180
181 focused::
182         Selects the currently focused desktop.
183
184 older::
185         Selects the desktop older than the focused desktop in the history.
186
187 newer::
188         Selects the desktop newer than the focused desktop in the history.
189
190 Modifiers
191 ^^^^^^^^^
192
193 [!]occupied::
194         Only consider occupied or free desktops.
195
196 [!]focused::
197         Only consider focused or unfocused desktops.
198
199 [!]urgent::
200         Only consider urgent or non urgent desktops.
201
202 [!]local::
203         Only consider inside or outside of the current monitor.
204
205 Monitor
206 ~~~~~~~
207
208 Select a monitor.
209
210 ----
211 MONITOR_SEL := (<monitor_name>|^<n>|DIR|CYCLE_DIR|last|primary|focused|older|newer)[.[!]occupied][.[!]focused]
212 ----
213
214 Descriptors
215 ^^^^^^^^^^^
216
217 <monitor_name>::
218         Selects the monitor with the given name.
219
220 ^<n>::
221         Selects the nth monitor.
222
223 'DIR'::
224         Selects the monitor in the given (spacial) direction relative to the active monitor.
225
226 'CYCLE_DIR'::
227         Selects the monitor in the given (cyclic) direction relative to the active monitor.
228
229 primary::
230         Selects the primary monitor.
231
232 last::
233         Selects the previously focused monitor.
234
235 focused::
236         Selects the currently focused monitor.
237
238 older::
239         Selects the monitor older than the focused monitor in the history.
240
241 newer::
242         Selects the monitor newer than the focused monitor in the history.
243
244 Modifiers
245 ^^^^^^^^^
246
247 [!]occupied::
248         Only consider monitors where the focused desktop is occupied or free.
249
250 [!]focused::
251         Only consider focused or unfocused monitors.
252
253
254 Window States
255 -------------
256
257 tiled::
258         Its size and position are determined by the splitting type and ratio of each node of its path in the window tree.
259
260 pseudo_tiled::
261         Has an unrestricted size while being centered in its tiling space.
262
263 floating::
264         Can be moved/resized freely. Although it doesn't occupy any tiling space, it is still part of the window tree.
265
266 fullscreen::
267         Fills its monitor rectangle and has no borders. It is send in the ABOVE layer by default.
268
269
270 Node Flags
271 ----------
272
273 locked::
274         Ignores the *node --close* message.
275
276 sticky::
277         Stays in the focused desktop of its monitor.
278
279 private::
280         Tries to keep the same tiling position/size.
281
282 urgent::
283         Has its urgency hint set. This flag is set externally.
284
285
286 Stacking Layers
287 --------------
288
289 There's three stacking layers: BELOW, NORMAL and ABOVE.
290
291 In each layer, the window are orderered as follow: tiled & pseudo-tiled < fullscreen < floating.
292
293
294 Domains
295 -------
296
297 Node
298 ~~~~
299
300 General Syntax
301 ^^^^^^^^^^^^^^
302
303 node ['NODE_SEL'] 'COMMANDS'
304
305 Commands
306 ^^^^^^^^
307 *-f*, *--focus* ['NODE_SEL']::
308         Focus the selected or given node.
309
310 *-a*, *--activate* ['NODE_SEL']::
311         Activate the selected or given node.
312
313 *-d*, *--to-desktop* 'DESKTOP_SEL'::
314         Send the selected node to the given desktop.
315
316 *-m*, *--to-monitor* 'MONITOR_SEL'::
317         Send the selected node to the given monitor.
318
319 *-n*, *--to-node* 'NODE_SEL'::
320         Transplant the selected node to the given node.
321
322 *-s*, *--swap* 'NODE_SEL'::
323         Swap the selected node with the given node.
324
325 *-p*, *--presel-dir* \[~]'DIR'|cancel::
326         Preselect the splitting area of the selected node (or cancel the preselection). If *~* is prepended to 'DIR' and the current preselection direction matches 'DIR', then the argument is interpreted as *cancel*.
327
328 *-o*, *--presel-ratio* 'RATIO'::
329         Set the splitting ratio of the preselection area.
330
331 *-r*, *--ratio* 'RATIO'|(+|-)'PIXELS'::
332         Set the splitting ratio of the selected node (0 < 'RATIO' < 1).
333
334 *-R*, *--rotate* '90|270|180'::
335         Rotate the tree rooted at the selected node.
336
337 *-F*, *--flip* 'horizontal|vertical'::
338         Flip the the tree rooted at selected node.
339
340 *-E*, *--equalize*::
341         Reset the split ratios of the tree rooted at the selected node to their default value.
342
343 *-B*, *--balance*::
344         Adjust the split ratios of the tree rooted at the selected node so that all windows occupy the same area.
345
346 *-C*, *--circulate* forward|backward::
347         Circulate the windows of the tree rooted at the selected node.
348
349 *-t*, *--state* [~](tiled|pseudo_tiled|floating|fullscreen)::
350         Set the state of the selected window. If *~* is present and the current state matches the given state, then the argument is interpreted as the last state.
351
352 *-g*, *--flag* locked|sticky|private[=on|off]::
353         Set or toggle the given flag for the selected node.
354
355 *-l*, *--layer* below|normal|above::
356         Set the stacking layer of the selected window.
357
358 *-c*, *--close*::
359         Close the windows rooted at the selected node.
360
361 *-k*, *--kill*::
362         Kill the windows rooted at the selected node.
363
364 Desktop
365 ~~~~~~~
366
367 General Syntax
368 ^^^^^^^^^^^^^^
369
370 desktop ['DESKTOP_SEL'] 'COMMANDS'
371
372 COMMANDS
373 ^^^^^^^^
374 *-f*, *--focus* ['DESKTOP_SEL']::
375         Focus the selected or given desktop.
376
377 *-a*, *--activate* ['DESKTOP_SEL']::
378         Activate the selected or given desktop.
379
380 *-m*, *--to-monitor* 'MONITOR_SEL'::
381         Send the selected desktop to the given monitor.
382
383 *-l*, *--layout* 'CYCLE_DIR'|monocle|tiled::
384         Set or cycle the layout of the selected desktop.
385
386 *-n*, *--rename* <new_name>::
387         Rename the selected desktop.
388
389 *-s*, *--swap* 'DESKTOP_SEL'::
390         Swap the selected desktop with the given desktop.
391
392 *-b*, *--bubble* 'CYCLE_DIR'::
393         Bubble the selected desktop in the given direction.
394
395 *-r*, *--remove*::
396         Remove the selected desktop.
397
398 Monitor
399 ~~~~~~~
400
401 General Syntax
402 ^^^^^^^^^^^^^^
403
404 monitor ['MONITOR_SEL'] 'COMMANDS'
405
406 Commands
407 ^^^^^^^^
408 *-f*, *--focus* ['MONITOR_SEL']::
409         Focus the selected or given monitor.
410
411 *-a*, *--add-desktops* <name>...::
412         Create desktops with the given names in the selected monitor.
413
414 *-r*, *--remove-desktops* <name>...::
415         Remove desktops with the given names.
416
417 *-o*, *--reorder-desktops* <name>...::
418         Reorder the desktops of the selected monitor to match the given order.
419
420 *-d*, *--reset-desktops* <name>...::
421         Rename, add or remove desktops depending on whether the number of given names is equal, superior or inferior to the number of existing desktops. Incidentally reset the settings of the existing desktops.
422
423 *-g*, *--rectangle* WxH+X+Y::
424         Set the rectangle of the selected monitor.
425
426 *-n*, *--rename* <new_name>::
427         Rename the selected monitor.
428
429 *-s*, *--swap* 'MONITOR_SEL'::
430         Swap the selected monitor with the given monitor.
431
432 Query
433 ~~~~~
434
435 General Syntax
436 ^^^^^^^^^^^^^^
437
438 query 'COMMANDS' ['OPTIONS']
439
440 Commands
441 ^^^^^^^^
442
443 *-N*, *--nodes*::
444         List the IDs of the matching nodes.
445
446 *-D*, *--desktops*::
447         List the names of the matching desktops.
448
449 *-M*, *--monitors*::
450         List the names of the matching monitors.
451
452 *-T*, *--tree*::
453         Print a JSON representation of the matching item.
454
455 Options
456 ^^^^^^^
457
458 [*-m*,*--monitor* ['MONITOR_SEL']] | [*-d*,*--desktop* ['DESKTOP_SEL']] | [*-n*, *--node* ['NODE_SEL']]::
459         Constrain matches to the selected monitor, desktop or node. The descriptor can be omitted for '-M', '-D' and '-N'.
460
461 Wm
462 ~~
463
464 General Syntax
465 ^^^^^^^^^^^^^^
466
467 wm 'COMMANDS'
468
469 Commands
470 ^^^^^^^^
471
472 *-d*, *--dump-state*::
473         Dump the current world state on standard output.
474
475 *-l*, *--load-state* <file_path>::
476         Load a world state from the given file.
477
478 *-a*, *--add-monitor* <name> WxH+X+Y::
479         Add a monitor for the given name and rectangle.
480
481 *-r*, *--remove-monitor* <name>::
482         Remove the monitor with the given name.
483
484 *-o*, *--adopt-orphans*::
485         Manage all the unmanaged windows remaining from a previous session.
486
487 *-h*, *--record-history* on|off::
488         Enable or disable the recording of node focus history.
489
490 *-g*, *--get-status*::
491         Print the current status information.
492
493 Pointer
494 ~~~~~~~
495
496 General Syntax
497 ^^^^^^^^^^^^^^
498
499 pointer 'COMMANDS'
500
501 Commands
502 ^^^^^^^^
503
504 *-g*, *--grab* focus|move|resize_side|resize_corner::
505         Initiate the given pointer action.
506
507 *-t*, *--track* <x> <y>::
508         Pass the pointer root coordinates for the current pointer action.
509
510 *-u*, *--ungrab*::
511         Terminate the current pointer action.
512
513 Rule
514 ~~~~
515
516 General Syntax
517 ^^^^^^^^^^^^^^
518
519 rule 'COMMANDS'
520
521 Commands
522 ^^^^^^^^
523
524 *-a*, *--add* (<class_name>|\*)[:(<instance_name>|\*)] [*-o*|*--one-shot*] [monitor=MONITOR_SEL|desktop=DESKTOP_SEL|node=NODE_SEL] [state=STATE] [layer=LAYER] [split_dir=DIR] [split_ratio=RATIO] [(locked|sticky|private|center|follow|manage|focus|border)=(on|off)]::
525         Create a new rule.
526
527 *-r*, *--remove* ^<n>|head|tail|(<class_name>|\*)[:(<instance_name>|*)]...::
528         Remove the given rules.
529
530 *-l*, *--list*::
531         List the rules.
532
533 Config
534 ~~~~~~
535
536 General Syntax
537 ^^^^^^^^^^^^^^
538
539 config [-m 'MONITOR_SEL'|-d 'DESKTOP_SEL'|-n 'NODE_SEL'] <key> [<value>]::
540         Get or set the value of <key>.
541
542 Subscribe
543 ~~~~~~~~~
544
545 General Syntax
546 ^^^^^^^^^^^^^^
547 subscribe (all|report|monitor|desktop|window|...)*::
548         Continuously print status information. See the *EVENTS* section for the detailed description of each event.
549
550 Quit
551 ~~~~
552
553 General Syntax
554 ^^^^^^^^^^^^^^
555
556 quit [<status>]::
557         Quit with an optional exit status.
558
559 Exit Codes
560 ----------
561
562 If the server can't handle a message, *bspc* will return with one of the following exit codes:
563
564 1::
565         Failure.
566 2::
567         Syntax error.
568 3::
569         Unknown command.
570
571
572 Settings
573 --------
574 Colors are in the form '#RRGGBB', booleans are 'true', 'on', 'false' or 'off'.
575
576 All the boolean settings are 'false' by default unless stated otherwise.
577
578 Global Settings
579 ~~~~~~~~~~~~~~~
580
581 'normal_border_color'::
582         Color of the border of an unfocused window.
583
584 'active_border_color'::
585         Color of the border of a focused window of an unfocused monitor.
586
587 'focused_border_color'::
588         Color of the border of a focused window of a focused monitor.
589
590 'presel_feedback_color'::
591         Color of the *node --presel-{dir,ratio}* message feedback area.
592
593 'split_ratio'::
594         Default split ratio.
595
596 'status_prefix'::
597         Prefix prepended to each of the status lines.
598
599 'external_rules_command'::
600         External command used to retrieve rule consequences. The command will receive the the ID of the window being processed as its first argument and the class and instance names as second and third arguments. The output of that command must have the following format: *key1=value1 key2=value2 ...* (the valid key/value pairs are given in the description of the 'rule' command).
601
602 'initial_polarity'::
603         On which child should a new window be attached when adding a window on a single window tree in automatic mode. Accept the following values: *first_child*, *second_child*.
604
605 'history_aware_focus'::
606         Give priority to the focus history when focusing nodes.
607
608 'focus_by_distance'::
609         Base focusing on distances between windows.
610
611 'borderless_monocle'::
612         Remove borders of tiled windows for the *monocle* desktop layout.
613
614 'gapless_monocle'::
615         Remove gaps of tiled windows for the *monocle* desktop layout.
616
617 'single_monocle'::
618         Set the desktop layout to *monocle* if there's only one tiled window in the tree.
619
620 'focus_follows_pointer'::
621         Focus the window under the pointer.
622
623 'pointer_follows_focus'::
624         When focusing a window, put the pointer at its center.
625
626 'pointer_follows_monitor'::
627         When focusing a monitor, put the pointer at its center.
628
629 'ignore_ewmh_focus'::
630         Ignore EWMH focus requests coming from applications.
631
632 'center_pseudo_tiled'::
633         Center pseudo tiled windows into their tiling rectangles. Defaults to 'true'.
634
635 'remove_disabled_monitors'::
636         Consider disabled monitors as disconnected.
637
638 'remove_unplugged_monitors'::
639         Remove unplugged monitors.
640
641 'merge_overlapping_monitors'::
642         Merge overlapping monitors (the bigger remains).
643
644 Monitor and Desktop Settings
645 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
646
647 'top_padding'::
648 'right_padding'::
649 'bottom_padding'::
650 'left_padding'::
651         Padding space added at the sides of the monitor or desktop.
652
653 Default, Desktop Default and Window Settings
654 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
655
656 'border_width'::
657         Window border width.
658
659 Default and Desktop Settings
660 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
661
662 'window_gap'::
663         Size of the gap that separates windows.
664
665
666 Events
667 ------
668
669 'report'::
670         See the next section for the description of the format.
671
672 'monitor_add <monitor_name> <monitor_id> <monitor_geometry>'::
673         A monitor is added.
674
675 'monitor_rename <old_name> <new_name>'::
676         A monitor is renamed.
677
678 'monitor_remove <monitor_name>'::
679         A monitor is removed.
680
681 'monitor_focus <monitor_name>'::
682         A monitor is focused.
683
684 'monitor_geometry <monitor_name> <monitor_geometry>'::
685         The geometry of a monitor changed.
686
687 'desktop_add <monitor_name> <desktop_name>'::
688         A desktop is added.
689
690 'desktop_rename <monitor_name> <old_name> <new_name>'::
691         A desktop is renamed.
692
693 'desktop_remove <monitor_name> <desktop_name>'::
694         A desktop is removed.
695
696 'desktop_swap <src_monitor_name> <src_desktop_name> <dst_monitor_name> <dst_desktop_name>'::
697         A desktop is swapped.
698
699 'desktop_transfer <src_monitor_name> <src_desktop_name> <dst_monitor_name>'::
700         A desktop is transferred.
701
702 'desktop_focus <monitor_name> <desktop_name>'::
703         A desktop is focused.
704
705 'desktop_activate <monitor_name> <desktop_name>'::
706         A desktop is activated.
707
708 'desktop_layout <monitor_name> <desktop_name> tiled|monocle'::
709         The layout of a desktop changed.
710
711 'node_manage <monitor_name> <desktop_name> <node_id> <ip_id>'::
712         A window is managed.
713
714 'node_unmanage <monitor_name> <desktop_name> <node_id>'::
715         A window is unmanaged.
716
717 'node_swap <src_monitor_name> <src_desktop_name> <src_node_id> <dst_monitor_name> <dst_desktop_name> <dst_node_id>'::
718         A node is swapped.
719
720 'node_transfer <src_monitor_name> <src_desktop_name> <src_node_id> <dst_monitor_name> <dst_desktop_name> <dst_node_id>'::
721         A node is transferred.
722
723 'node_focus <monitor_name> <desktop_name> <node_id>'::
724         A node is focused.
725
726 'node_activate <monitor_name> <desktop_name> <node_id>'::
727         A node is activated.
728
729 'node_presel <monitor_name> <desktop_name> <node_id> (dir DIR|ratio RATIO|cancel)'::
730         A node is preselected.
731
732 'node_stack <node_id_1> below|above <node_id_2>'::
733         A node is stacked below or above another node.
734
735 'node_geometry <monitor_name> <desktop_name> <node_id> <node_geometry>'::
736         The geometry of a window changed.
737
738 'node_state <monitor_name> <desktop_name> <node_id> tiled|pseudo_tiled|floating|fullscreen on|off'::
739         The state of a window changed.
740
741 'node_flag <monitor_name> <desktop_name> <node_id> sticky|private|locked|urgent on|off'::
742         One of the flags of a node changed.
743
744 'node_layer <monitor_name> <desktop_name> <node_id> below|normal|above'::
745         The layer of a window changed.
746
747 Please note that *bspwm* initializes monitors before it reads messages on its socket, therefore the initial monitor events can't be received.
748
749 Report Format
750 -------------
751
752 Each report event message is composed of items separated by colons.
753
754 Each item has the form '<type><value>' where '<type>' is the first character of the item.
755
756 'M<monitor_name>'::
757         Focused monitor.
758
759 'm<monitor_name>'::
760         Unfocused monitor.
761
762 'O<desktop_name>'::
763         Occupied focused desktop.
764
765 'o<desktop_name>'::
766         Occupied unfocused desktop.
767
768 'F<desktop_name>'::
769         Free focused desktop.
770
771 'f<desktop_name>'::
772         Free unfocused desktop.
773
774 'U<desktop_name>'::
775         Urgent focused desktop.
776
777 'u<desktop_name>'::
778         Urgent unfocused desktop.
779
780 'L(T|M)'::
781         Layout of the focused desktop of a monitor.
782
783 'T(T|P|F|=|@)'::
784         State of the focused node of a focused desktop.
785
786 'G(S?P?L?)'::
787         Active flags of the focused node of a focused desktop.
788
789 Environment Variables
790 ---------------------
791
792 'BSPWM_SOCKET'::
793         The path of the socket used for the communication between *bspc* and *bspwm*. If it isn't defined, then the following path is used: '/tmp/bspwm<host_name>_<display_number>_<screen_number>-socket'.
794
795 Contributors
796 ------------
797
798 * Steven Allen <steven at stebalien.com>
799 * Thomas Adam <thomas at xteddy.org>
800 * Ivan Kanakarakis <ivan.kanak at gmail.com>
801
802 Author
803 ------
804
805 Bastien Dejean <nihilhill at gmail.com>