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