2 :man version: {revnumber}
3 :man manual: Bspwm Manual
11 bspwm - Binary space partitioning window manager
16 *bspwm* [*-h*|*-v*|*-c* 'CONFIG_PATH']
18 *bspc* 'DOMAIN' ['SELECTOR'] 'COMMANDS'
20 *bspc* 'COMMAND' ['OPTIONS'] ['ARGUMENTS']
25 *bspwm* is a tiling window manager that represents windows as the leaves of a full binary tree.
27 It is controlled and configured via *bspc*.
34 Print the synopsis and exit.
37 Print the version and exit.
40 Use the given configuration file.
46 DIR := north | west | south | east
47 CYCLE_DIR := next | prev
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.
56 Selectors consist of a descriptor and any number of non-conflicting modifiers
59 DESCRIPTOR(.MODIFIER)*
61 An exclamation mark can be prepended to certain modifiers in order to reverse their meaning.
69 NODE_SEL := (DIR|CYCLE_DIR|PATH|last|older|newer|focused|biggest|<node_id>)[.[!]focused][.[!]automatic][.[!]local][.[!]leaf][.[!]window][.[!]STATE][.[!]FLAG][.[!]LAYER][.[!]same_class]
71 STATE := tiled|pseudo_tiled|floating|fullscreen
73 FLAG := urgent|sticky|private|locked
75 LAYER := below|normal|above
77 PATH := @[DESKTOP_SEL:][[/]JUMP](/JUMP)*
79 JUMP := first|1|second|2|brother|parent|DIR
86 Selects the window in the given (spacial) direction relative to the active node.
89 Selects the window in the given (cyclic) direction.
92 Selects the node at the given path.
95 Selects the previously focused node.
98 Selects the node older than the focused node in the history.
101 Selects the node newer than the focused node in the history.
104 Selects the currently focused node.
107 Selects the biggest window on the current desktop.
110 Selects the node with the given ID.
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).
118 Jumps to the first child.
121 Jumps to the second child.
124 Jumps to the brother node.
127 Jumps to the parent node.
130 Jumps to the node holding the edge in the given direction.
136 Only consider focused or unfocused nodes.
139 Only consider nodes in automatic or manual insertion mode.
142 Only consider nodes in or not in the current desktop.
145 Only consider leaves or internal nodes.
148 Only consider nodes that hold or don't hold a window.
150 [!](tiled|pseudo_tiled|floating|fullscreen)::
151 Only consider windows in or not in the given state.
154 Only consider windows that have or don't have the same class as the current window.
156 [!](private|urgent|sticky|locked)::
157 Only consider windows that have or don't have the given flag set.
159 [!](below|normal|above)::
160 Only consider windows in or not in the given layer.
168 DESKTOP_SEL := (CYCLE_DIR|last|older|newer|[MONITOR_SEL:](focused|^<n>)|<desktop_id>|<desktop_name>)[.[!]occupied][.[!]focused][.[!]urgent][.[!]local]
175 Selects the desktop in the given direction relative to the active desktop.
178 Selects the previously focused desktop.
181 Selects the desktop older than the focused desktop in the history.
184 Selects the desktop newer than the focused desktop in the history.
187 Selects the currently focused desktop.
190 Selects the nth desktop.
193 Selects the desktop with the given ID.
196 Selects the desktop with the given name.
202 Only consider occupied or free desktops.
205 Only consider focused or unfocused desktops.
208 Only consider urgent or non urgent desktops.
211 Only consider inside or outside of the current monitor.
219 MONITOR_SEL := (DIR|CYCLE_DIR|last|older|newer|focused|primary|^<n>|<monitor_id>|<monitor_name>)[.[!]occupied][.[!]focused]
226 Selects the monitor in the given (spacial) direction relative to the active monitor.
229 Selects the monitor in the given (cyclic) direction relative to the active monitor.
232 Selects the previously focused monitor.
235 Selects the monitor older than the focused monitor in the history.
238 Selects the monitor newer than the focused monitor in the history.
241 Selects the currently focused monitor.
244 Selects the primary monitor.
247 Selects the nth monitor.
250 Selects the monitor with the given ID.
253 Selects the monitor with the given name.
260 Only consider monitors where the focused desktop is occupied or free.
263 Only consider focused or unfocused monitors.
270 Its size and position are determined by the splitting type and ratio of each node of its path in the window tree.
273 Has an unrestricted size while being centered in its tiling space.
276 Can be moved/resized freely. Although it doesn't occupy any tiling space, it is still part of the window tree.
279 Fills its monitor rectangle and has no borders. It is send in the ABOVE layer by default.
286 Ignores the *node --close* message.
289 Stays in the focused desktop of its monitor.
292 Tries to keep the same tiling position/size.
295 Has its urgency hint set. This flag is set externally.
301 There's three stacking layers: BELOW, NORMAL and ABOVE.
303 In each layer, the window are orderered as follow: tiled & pseudo-tiled < fullscreen < floating.
315 node ['NODE_SEL'] 'COMMANDS'
319 *-f*, *--focus* ['NODE_SEL']::
320 Focus the selected or given node.
322 *-a*, *--activate* ['NODE_SEL']::
323 Activate the selected or given node.
325 *-d*, *--to-desktop* 'DESKTOP_SEL'::
326 Send the selected node to the given desktop.
328 *-m*, *--to-monitor* 'MONITOR_SEL'::
329 Send the selected node to the given monitor.
331 *-n*, *--to-node* 'NODE_SEL'::
332 Transplant the selected node to the given node.
334 *-s*, *--swap* 'NODE_SEL'::
335 Swap the selected node with the given node.
337 *-p*, *--presel-dir* \[~]'DIR'|cancel::
338 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*.
340 *-o*, *--presel-ratio* 'RATIO'::
341 Set the splitting ratio of the preselection area.
343 *-v*, *--move* 'dx' 'dy'::
344 Move the selected window by 'dx' pixels horizontally and 'dy' pixels vertically.
346 *-z*, *--resize* top|left|bottom|right|top_left|top_right|bottom_right|bottom_left 'dx' 'dy'::
347 Resize the selected window by moving the given handle by 'dx' pixels horizontally and 'dy' pixels vertically.
349 *-r*, *--ratio* 'RATIO'|(+|-)'PIXELS'::
350 Set the splitting ratio of the selected node (0 < 'RATIO' < 1).
352 *-R*, *--rotate* '90|270|180'::
353 Rotate the tree rooted at the selected node.
355 *-F*, *--flip* 'horizontal|vertical'::
356 Flip the the tree rooted at selected node.
359 Reset the split ratios of the tree rooted at the selected node to their default value.
362 Adjust the split ratios of the tree rooted at the selected node so that all windows occupy the same area.
364 *-C*, *--circulate* forward|backward::
365 Circulate the windows of the tree rooted at the selected node.
367 *-t*, *--state* [~](tiled|pseudo_tiled|floating|fullscreen)::
368 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.
370 *-g*, *--flag* locked|sticky|private[=on|off]::
371 Set or toggle the given flag for the selected node.
373 *-l*, *--layer* below|normal|above::
374 Set the stacking layer of the selected window.
376 *-i*, *--insert-receptacle*::
377 Insert a receptacle node at the selected node.
380 Close the windows rooted at the selected node.
383 Kill the windows rooted at the selected node.
391 desktop ['DESKTOP_SEL'] 'COMMANDS'
395 *-f*, *--focus* ['DESKTOP_SEL']::
396 Focus the selected or given desktop.
398 *-a*, *--activate* ['DESKTOP_SEL']::
399 Activate the selected or given desktop.
401 *-m*, *--to-monitor* 'MONITOR_SEL'::
402 Send the selected desktop to the given monitor.
404 *-l*, *--layout* 'CYCLE_DIR'|monocle|tiled::
405 Set or cycle the layout of the selected desktop.
407 *-n*, *--rename* <new_name>::
408 Rename the selected desktop.
410 *-s*, *--swap* 'DESKTOP_SEL'::
411 Swap the selected desktop with the given desktop.
413 *-b*, *--bubble* 'CYCLE_DIR'::
414 Bubble the selected desktop in the given direction.
417 Remove the selected desktop.
425 monitor ['MONITOR_SEL'] 'COMMANDS'
429 *-f*, *--focus* ['MONITOR_SEL']::
430 Focus the selected or given monitor.
432 *-a*, *--add-desktops* <name>...::
433 Create desktops with the given names in the selected monitor.
435 *-o*, *--reorder-desktops* <name>...::
436 Reorder the desktops of the selected monitor to match the given order.
438 *-d*, *--reset-desktops* <name>...::
439 Rename, add or remove desktops depending on whether the number of given names is equal, superior or inferior to the number of existing desktops.
441 *-g*, *--rectangle* WxH+X+Y::
442 Set the rectangle of the selected monitor.
444 *-n*, *--rename* <new_name>::
445 Rename the selected monitor.
447 *-s*, *--swap* 'MONITOR_SEL'::
448 Swap the selected monitor with the given monitor.
451 Remove the selected monitor.
459 query 'COMMANDS' ['OPTIONS']
465 List the IDs of the matching nodes.
468 List the IDs of the matching desktops.
471 List the IDs of the matching monitors.
474 Print a JSON representation of the matching item.
479 [*-m*,*--monitor* ['MONITOR_SEL']] | [*-d*,*--desktop* ['DESKTOP_SEL']] | [*-n*, *--node* ['NODE_SEL']]::
480 Constrain matches to the selected monitor, desktop or node. The descriptor can be omitted for '-M', '-D' and '-N'.
493 *-d*, *--dump-state*::
494 Dump the current world state on standard output.
496 *-l*, *--load-state* <file_path>::
497 Load a world state from the given file.
499 *-a*, *--add-monitor* <name> WxH+X+Y::
500 Add a monitor for the given name and rectangle.
502 *-o*, *--adopt-orphans*::
503 Manage all the unmanaged windows remaining from a previous session.
505 *-h*, *--record-history* on|off::
506 Enable or disable the recording of node focus history.
508 *-g*, *--get-status*::
509 Print the current status information.
522 *-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 *-r*, *--remove* ^<n>|head|tail|(<class_name>|\*)[:(<instance_name>|*)]...::
526 Remove the given rules.
537 config [-m 'MONITOR_SEL'|-d 'DESKTOP_SEL'|-n 'NODE_SEL'] <key> [<value>]::
538 Get or set the value of <key>.
545 subscribe (all|report|monitor|desktop|node|...)*::
546 Continuously print status information. See the *EVENTS* section for the detailed description of each event.
555 Quit with an optional exit status.
560 If the server can't handle a message, *bspc* will return with a non-zero exit code.
564 Colors are in the form '#RRGGBB', booleans are 'true', 'on', 'false' or 'off'.
566 All the boolean settings are 'false' by default unless stated otherwise.
571 'normal_border_color'::
572 Color of the border of an unfocused window.
574 'active_border_color'::
575 Color of the border of a focused window of an unfocused monitor.
577 'focused_border_color'::
578 Color of the border of a focused window of a focused monitor.
580 'presel_feedback_color'::
581 Color of the *node --presel-{dir,ratio}* message feedback area.
587 Prefix prepended to each of the status lines.
589 'external_rules_command'::
590 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).
593 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*.
595 'history_aware_focus'::
596 Give priority to the focus history when focusing nodes.
598 'focus_by_distance'::
599 Base focusing on distances between windows.
601 'borderless_monocle'::
602 Remove borders of tiled windows for the *monocle* desktop layout.
605 Remove gaps of tiled windows for the *monocle* desktop layout.
607 'paddingless_monocle'::
608 Remove padding space for the *monocle* desktop layout.
611 Set the desktop layout to *monocle* if there's only one tiled window in the tree.
614 Keyboard modifier used for moving or resizing windows. Accept the following values: *shift*, *control*, *lock*, *mod1*, *mod2*, *mod3*, *mod4*, *mod5*.
619 Action performed when pressing 'pointer_modifier' + 'button<n>'. Accept the following values: *move*, *resize_side*, *resize_corner*, *focus*.
622 Focus a window (or a monitor) by clicking it.
624 'focus_follows_pointer'::
625 Focus the window under the pointer.
627 'pointer_follows_focus'::
628 When focusing a window, put the pointer at its center.
630 'pointer_follows_monitor'::
631 When focusing a monitor, put the pointer at its center.
633 'ignore_ewmh_focus'::
634 Ignore EWMH focus requests coming from applications.
636 'center_pseudo_tiled'::
637 Center pseudo tiled windows into their tiling rectangles. Defaults to 'true'.
640 Apply ICCCM window size hints.
642 'remove_disabled_monitors'::
643 Consider disabled monitors as disconnected.
645 'remove_unplugged_monitors'::
646 Remove unplugged monitors.
648 'merge_overlapping_monitors'::
649 Merge overlapping monitors (the bigger remains).
651 Monitor and Desktop Settings
652 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
658 Padding space added at the sides of the monitor or desktop.
664 Size of the gap that separates windows.
676 Focus the window under the pointer if 'click_to_focus' is set.
678 'pointer_modifier' + 'button1'::
679 Move the window under the pointer.
681 'pointer_modifier' + 'button2'::
682 Resize the window under the pointer by dragging the nearest side.
684 'pointer_modifier' + 'button3'::
685 Resize the window under the pointer by dragging the nearest corner.
687 The behavior of 'pointer_modifier' + 'button<n>' can be modified through the 'pointer_action<n>' setting.
693 See the next section for the description of the format.
695 'monitor_add <monitor_id> <monitor_name> <monitor_geometry>'::
698 'monitor_rename <monitor_id> <old_name> <new_name>'::
699 A monitor is renamed.
701 'monitor_remove <monitor_id>'::
702 A monitor is removed.
704 'monitor_swap <src_monitor_id> <dst_monitor_id>'::
705 A monitor is swapped.
707 'monitor_focus <monitor_id>'::
708 A monitor is focused.
710 'monitor_geometry <monitor_id> <monitor_geometry>'::
711 The geometry of a monitor changed.
713 'desktop_add <monitor_id> <desktop_id> <desktop_name>'::
716 'desktop_rename <monitor_id> <desktop_id> <old_name> <new_name>'::
717 A desktop is renamed.
719 'desktop_remove <monitor_id> <desktop_id>'::
720 A desktop is removed.
722 'desktop_swap <src_monitor_id> <src_desktop_id> <dst_monitor_id> <dst_desktop_id>'::
723 A desktop is swapped.
725 'desktop_transfer <src_monitor_id> <src_desktop_id> <dst_monitor_id>'::
726 A desktop is transferred.
728 'desktop_focus <monitor_id> <desktop_id>'::
729 A desktop is focused.
731 'desktop_activate <monitor_id> <desktop_id>'::
732 A desktop is activated.
734 'desktop_layout <monitor_id> <desktop_id> tiled|monocle'::
735 The layout of a desktop changed.
737 'node_manage <monitor_id> <desktop_id> <node_id> <ip_id>'::
740 'node_unmanage <monitor_id> <desktop_id> <node_id>'::
741 A window is unmanaged.
743 'node_swap <src_monitor_id> <src_desktop_id> <src_node_id> <dst_monitor_id> <dst_desktop_id> <dst_node_id>'::
746 'node_transfer <src_monitor_id> <src_desktop_id> <src_node_id> <dst_monitor_id> <dst_desktop_id> <dst_node_id>'::
747 A node is transferred.
749 'node_focus <monitor_id> <desktop_id> <node_id>'::
752 'node_activate <monitor_id> <desktop_id> <node_id>'::
755 'node_presel <monitor_id> <desktop_id> <node_id> (dir DIR|ratio RATIO|cancel)'::
756 A node is preselected.
758 'node_stack <node_id_1> below|above <node_id_2>'::
759 A node is stacked below or above another node.
761 'node_geometry <monitor_id> <desktop_id> <node_id> <node_geometry>'::
762 The geometry of a window changed.
764 'node_state <monitor_id> <desktop_id> <node_id> tiled|pseudo_tiled|floating|fullscreen on|off'::
765 The state of a window changed.
767 'node_flag <monitor_id> <desktop_id> <node_id> sticky|private|locked|urgent on|off'::
768 One of the flags of a node changed.
770 'node_layer <monitor_id> <desktop_id> <node_id> below|normal|above'::
771 The layer of a window changed.
773 Please note that *bspwm* initializes monitors before it reads messages on its socket, therefore the initial monitor events can't be received.
778 Each report event message is composed of items separated by colons.
780 Each item has the form '<type><value>' where '<type>' is the first character of the item.
789 Occupied focused desktop.
792 Occupied unfocused desktop.
795 Free focused desktop.
798 Free unfocused desktop.
801 Urgent focused desktop.
804 Urgent unfocused desktop.
807 Layout of the focused desktop of a monitor.
810 State of the focused node of a focused desktop.
813 Active flags of the focused node of a focused desktop.
815 Environment Variables
816 ---------------------
819 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'.
824 * Steven Allen <steven at stebalien.com>
825 * Thomas Adam <thomas at xteddy.org>
826 * Ivan Kanakarakis <ivan.kanak at gmail.com>
831 Bastien Dejean <nihilhill at gmail.com>