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