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 an optional reference, a descriptor and any number of
57 non-conflicting modifiers as follows:
59 [REFERENCE#]DESCRIPTOR(.MODIFIER)*
61 The relative targets are computed in relation to the given reference (the
62 default reference value is *focused*).
64 An exclamation mark can be prepended to any modifier in order to reverse its
67 The following characters cannot be used in monitor or desktop names: *#*, *:*, *.*.
69 The special selector *%<name>* can be used to select a monitor or a desktop with an invalid name.
77 NODE_SEL := [NODE_SEL#](DIR|CYCLE_DIR|PATH|any|first_ancestor|last|newest|
78 older|newer|focused|pointed|biggest|smallest|
79 <node_id>)[.[!]focused][.[!]active][.[!]automatic][.[!]local]
80 [.[!]leaf][.[!]window][.[!]STATE][.[!]FLAG][.[!]LAYER]
81 [.[!]same_class][.[!]descendant_of][.[!]ancestor_of]
83 STATE := tiled|pseudo_tiled|floating|fullscreen
85 FLAG := hidden|sticky|private|locked|marked|urgent
87 LAYER := below|normal|above
89 PATH := @[DESKTOP_SEL:][[/]JUMP](/JUMP)*
91 JUMP := first|1|second|2|brother|parent|DIR
98 Selects the window in the given (spacial) direction relative to the reference node.
101 Selects the window in the given (cyclic) direction relative to the reference node.
104 Selects the node at the given path.
107 Selects the first node that matches the given selectors.
110 Selects the first ancestor of the reference node that matches the given selectors.
113 Selects the previously focused node relative to the reference node.
116 Selects the newest node in the history of the focused node.
119 Selects the node older than the reference node in the history.
122 Selects the node newer than the reference node in the history.
125 Selects the currently focused node.
128 Selects the window under the pointer.
131 Selects the biggest window.
134 Selects the smallest window.
137 Selects the node with the given ID.
142 The initial node is the focused node (or the root if the path starts with '/') of the reference desktop (or the selected desktop if the path has a 'DESKTOP_SEL' prefix).
145 Jumps to the first child.
148 Jumps to the second child.
151 Jumps to the brother node.
154 Jumps to the parent node.
157 Jumps to the node holding the edge in the given direction.
163 Only consider the focused node.
166 Only consider nodes that are the focused node of their desktop.
169 Only consider nodes in automatic insertion mode. See also *--presel-dir* under *Node* in the *DOMAINS* section below.
172 Only consider nodes in the reference desktop.
175 Only consider leaf nodes.
178 Only consider nodes that hold a window.
180 [!](tiled|pseudo_tiled|floating|fullscreen)::
181 Only consider windows in the given state.
184 Only consider windows that have the same class as the reference window.
187 Only consider nodes that are descendants of the reference node.
190 Only consider nodes that are ancestors of the reference node.
192 [!](hidden|sticky|private|locked|marked|urgent)::
193 Only consider windows that have the given flag set.
195 [!](below|normal|above)::
196 Only consider windows in the given layer.
204 DESKTOP_SEL := [DESKTOP_SEL#](CYCLE_DIR|any|last|newest|older|newer|
205 [MONITOR_SEL:](focused|^<n>)|
206 <desktop_id>|<desktop_name>)[.[!]focused][.[!]active]
207 [.[!]occupied][.[!]urgent][.[!]local]
214 Selects the desktop in the given direction relative to the reference desktop.
217 Selects the first desktop that matches the given selectors.
220 Selects the previously focused desktop relative to the reference desktop.
223 Selects the newest desktop in the history of the focused desktops.
226 Selects the desktop older than the reference desktop in the history.
229 Selects the desktop newer than the reference desktop in the history.
232 Selects the currently focused desktop.
235 Selects the nth desktop. If *MONITOR_SEL* is given, selects the nth desktop on the selected monitor.
238 Selects the desktop with the given ID.
241 Selects the desktop with the given name.
247 Only consider the focused desktop.
250 Only consider desktops that are the focused desktop of their monitor.
253 Only consider occupied desktops.
256 Only consider urgent desktops.
259 Only consider desktops inside the reference monitor.
267 MONITOR_SEL := [MONITOR_SEL#](DIR|CYCLE_DIR|any|last|newest|older|newer|
268 focused|pointed|primary|^<n>|
269 <monitor_id>|<monitor_name>)[.[!]focused][.[!]occupied]
276 Selects the monitor in the given (spacial) direction relative to the reference monitor.
279 Selects the monitor in the given (cyclic) direction relative to the reference monitor.
282 Selects the first monitor that matches the given selectors.
285 Selects the previously focused monitor relative to the reference monitor.
288 Selects the newest monitor in the history of the focused monitors.
291 Selects the monitor older than the reference monitor in the history.
294 Selects the monitor newer than the reference monitor in the history.
297 Selects the currently focused monitor.
300 Selects the monitor under the pointer.
303 Selects the primary monitor.
306 Selects the nth monitor.
309 Selects the monitor with the given ID.
312 Selects the monitor with the given name.
319 Only consider the focused monitor.
322 Only consider monitors where the focused desktop is occupied.
330 Its size and position are determined by the window tree.
333 A tiled window that automatically shrinks but doesn't stretch beyond its floating size.
336 Can be moved/resized freely. Although it doesn't use any tiling space, it is still part of the window tree.
339 Fills its monitor rectangle and has no borders.
346 Is hidden and doesn't occupy any tiling space.
349 Stays in the focused desktop of its monitor.
352 Tries to keep the same tiling position/size.
355 Ignores the *node --close* message.
358 Is marked (useful for deferred actions). A marked node becomes unmarked after being sent on a preselected node.
361 Has its urgency hint set. This flag is set externally.
367 There's three stacking layers: BELOW, NORMAL and ABOVE.
369 In each layer, the window are orderered as follow: tiled & pseudo-tiled < floating < fullscreen.
374 A leaf node that doesn't hold any window is called a receptacle. When a node is inserted on a receptacle in automatic mode, it will replace the receptacle. A receptacle can be inserted on a node, preselected and killed. Receptacles can therefore be used to build a tree whose leaves are receptacles. Using the appropriate rules, one can then send windows on the leaves of this tree. This feature is used in 'examples/receptacles' to store and recreate layouts.
386 node ['NODE_SEL'] 'COMMANDS'
388 If 'NODE_SEL' is omitted, *focused* is assumed.
392 *-f*, *--focus* ['NODE_SEL']::
393 Focus the selected or given node.
395 *-a*, *--activate* ['NODE_SEL']::
396 Activate the selected or given node.
398 *-d*, *--to-desktop* 'DESKTOP_SEL' [*--follow*]::
399 Send the selected node to the given desktop. If *--follow* is passed, the focused node will stay focused.
401 *-m*, *--to-monitor* 'MONITOR_SEL' [*--follow*]::
402 Send the selected node to the given monitor. If *--follow* is passed, the focused node will stay focused.
404 *-n*, *--to-node* 'NODE_SEL' [*--follow*]::
405 Send the selected node on the given node. If *--follow* is passed, the focused node will stay focused.
407 *-s*, *--swap* 'NODE_SEL' [*--follow*]::
408 Swap the selected node with the given node. If *--follow* is passed, the focused node will stay focused.
410 *-p*, *--presel-dir* \[~]'DIR'|cancel::
411 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*. A node with a preselected area is said to be in "manual insertion mode".
413 *-o*, *--presel-ratio* 'RATIO'::
414 Set the splitting ratio of the preselection area.
416 *-v*, *--move* 'dx' 'dy'::
417 Move the selected window by 'dx' pixels horizontally and 'dy' pixels vertically.
419 *-z*, *--resize* top|left|bottom|right|top_left|top_right|bottom_right|bottom_left 'dx' 'dy'::
420 Resize the selected window by moving the given handle by 'dx' pixels horizontally and 'dy' pixels vertically.
422 *-r*, *--ratio* 'RATIO'|(+|-)('PIXELS'|'FRACTION')::
423 Set the splitting ratio of the selected node (0 < 'RATIO' < 1).
425 *-R*, *--rotate* '90|270|180'::
426 Rotate the tree rooted at the selected node.
428 *-F*, *--flip* 'horizontal|vertical'::
429 Flip the the tree rooted at selected node.
432 Reset the split ratios of the tree rooted at the selected node to their default value.
435 Adjust the split ratios of the tree rooted at the selected node so that all windows occupy the same area.
437 *-C*, *--circulate* forward|backward::
438 Circulate the windows of the tree rooted at the selected node.
440 *-t*, *--state* [~](tiled|pseudo_tiled|floating|fullscreen)::
441 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.
443 *-g*, *--flag* hidden|sticky|private|locked|marked[=on|off]::
444 Set or toggle the given flag for the selected node.
446 *-l*, *--layer* below|normal|above::
447 Set the stacking layer of the selected window.
449 *-i*, *--insert-receptacle*::
450 Insert a receptacle node at the selected node.
453 Close the windows rooted at the selected node.
456 Kill the windows rooted at the selected node.
464 desktop ['DESKTOP_SEL'] 'COMMANDS'
466 If 'DESKTOP_SEL' is omitted, *focused* is assumed.
470 *-f*, *--focus* ['DESKTOP_SEL']::
471 Focus the selected or given desktop.
473 *-a*, *--activate* ['DESKTOP_SEL']::
474 Activate the selected or given desktop.
476 *-m*, *--to-monitor* 'MONITOR_SEL' [*--follow*]::
477 Send the selected desktop to the given monitor. If *--follow* is passed, the focused desktop will stay focused.
479 *-s*, *--swap* 'DESKTOP_SEL' [*--follow*]::
480 Swap the selected desktop with the given desktop. If *--follow* is passed, the focused desktop will stay focused.
482 *-l*, *--layout* 'CYCLE_DIR'|monocle|tiled::
483 Set or cycle the layout of the selected desktop.
485 *-n*, *--rename* <new_name>::
486 Rename the selected desktop.
488 *-b*, *--bubble* 'CYCLE_DIR'::
489 Bubble the selected desktop in the given direction.
492 Remove the selected desktop.
500 monitor ['MONITOR_SEL'] 'COMMANDS'
502 If 'MONITOR_SEL' is omitted, *focused* is assumed.
506 *-f*, *--focus* ['MONITOR_SEL']::
507 Focus the selected or given monitor.
509 *-s*, *--swap* 'MONITOR_SEL'::
510 Swap the selected monitor with the given monitor.
512 *-a*, *--add-desktops* <name>...::
513 Create desktops with the given names in the selected monitor.
515 *-o*, *--reorder-desktops* <name>...::
516 Reorder the desktops of the selected monitor to match the given order.
518 *-d*, *--reset-desktops* <name>...::
519 Rename, add or remove desktops depending on whether the number of given names is equal, superior or inferior to the number of existing desktops.
521 *-g*, *--rectangle* WxH+X+Y::
522 Set the rectangle of the selected monitor.
524 *-n*, *--rename* <new_name>::
525 Rename the selected monitor.
528 Remove the selected monitor.
536 query 'COMMANDS' ['OPTIONS']
541 The optional selectors are references.
543 *-N*, *--nodes* ['NODE_SEL']::
544 List the IDs of the matching nodes.
546 *-D*, *--desktops* ['DESKTOP_SEL']::
547 List the IDs (or names) of the matching desktops.
549 *-M*, *--monitors* ['MONITOR_SEL']::
550 List the IDs (or names) of the matching monitors.
553 Print a JSON representation of the matching item.
558 *-m*,*--monitor* ['MONITOR_SEL']::
559 *-d*,*--desktop* ['DESKTOP_SEL']::
560 *-n*, *--node* ['NODE_SEL']::
561 Constrain matches to the selected monitor, desktop or node. The descriptor can be omitted for '-M', '-D' and '-N'.
564 Print names instead of IDs. Can only be used with '-M' and '-D'.
577 *-d*, *--dump-state*::
578 Dump the current world state on standard output.
580 *-l*, *--load-state* <file_path>::
581 Load a world state from the given file. The path must be absolute.
583 *-a*, *--add-monitor* <name> WxH+X+Y::
584 Add a monitor for the given name and rectangle.
586 *-O*, *--reorder-monitors* <name>...::
587 Reorder the list of monitors to match the given order.
589 *-o*, *--adopt-orphans*::
590 Manage all the unmanaged windows remaining from a previous session.
592 *-h*, *--record-history* on|off::
593 Enable or disable the recording of node focus history.
595 *-g*, *--get-status*::
596 Print the current status information.
599 Restart the window manager
612 *-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] [(hidden|sticky|private|locked|marked|center|follow|manage|focus|border)=(on|off)] [rectangle=WxH+X+Y]::
615 *-r*, *--remove* ^<n>|head|tail|(<class_name>|\*)[:(<instance_name>|*)]...::
616 Remove the given rules.
627 config [-m 'MONITOR_SEL'|-d 'DESKTOP_SEL'|-n 'NODE_SEL'] <setting> [<value>]::
628 Get or set the value of <setting>.
635 subscribe ['OPTIONS'] (all|report|monitor|desktop|node|...)*::
636 Continuously print events. See the *EVENTS* section for the description of each event.
642 Print a path to a FIFO from which events can be read and return.
644 *-c*, *--count* 'COUNT'::
645 Stop the corresponding *bspc* process after having received 'COUNT' events.
654 Quit with an optional exit status.
659 If the server can't handle a message, *bspc* will return with a non-zero exit code.
663 Colors are in the form '#RRGGBB', booleans are 'true', 'on', 'false' or 'off'.
665 All the boolean settings are 'false' by default unless stated otherwise.
670 'normal_border_color'::
671 Color of the border of an unfocused window.
673 'active_border_color'::
674 Color of the border of a focused window of an unfocused monitor.
676 'focused_border_color'::
677 Color of the border of a focused window of a focused monitor.
679 'presel_feedback_color'::
680 Color of the *node --presel-{dir,ratio}* message feedback area.
686 Prefix prepended to each of the status lines.
688 'external_rules_command'::
689 Absolute path to the command used to retrieve rule consequences. The command will receive the following arguments: window ID, class name, instance name, and intermediate consequences. 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).
692 The insertion scheme used when the insertion point is in automatic mode. Accept the following values: *longest_side*, *alternate*, *spiral*.
695 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*.
697 'directional_focus_tightness'::
698 The tightness of the algorithm used to decide whether a window is on the 'DIR' side of another window. Accept the following values: *high*, *low*.
700 'removal_adjustment'::
701 Adjust the brother when unlinking a node from the tree in accordance with the automatic insertion scheme.
704 Draw the preselection feedback area. Defaults to 'true'.
706 'borderless_monocle'::
707 Remove borders of tiled windows for the *monocle* desktop layout.
710 Remove gaps of tiled windows for the *monocle* desktop layout.
712 'top_monocle_padding'::
713 'right_monocle_padding'::
714 'bottom_monocle_padding'::
715 'left_monocle_padding'::
716 Padding space added at the sides of the screen for the *monocle* desktop layout.
719 Set the desktop layout to *monocle* if there's only one tiled window in the tree.
721 'pointer_motion_interval'::
722 The minimum interval, in milliseconds, between two motion notify events.
725 Keyboard modifier used for moving or resizing windows. Accept the following values: *shift*, *control*, *lock*, *mod1*, *mod2*, *mod3*, *mod4*, *mod5*.
730 Action performed when pressing 'pointer_modifier' + 'button<n>'. Accept the following values: *move*, *resize_side*, *resize_corner*, *focus*, *none*.
733 Button used for focusing a window (or a monitor). The possible values are: *button1*, *button2*, *button3*, *any*, *none*. Defaults to *button1*.
735 'swallow_first_click'::
736 Don't replay the click that makes a window focused if 'click_to_focus' isn't *none*.
738 'focus_follows_pointer'::
739 Focus the window under the pointer.
741 'pointer_follows_focus'::
742 When focusing a window, put the pointer at its center.
744 'pointer_follows_monitor'::
745 When focusing a monitor, put the pointer at its center.
747 'mapping_events_count'::
748 Handle the next *mapping_events_count* mapping notify events. A negative value implies that every event needs to be handled.
750 'ignore_ewmh_focus'::
751 Ignore EWMH focus requests coming from applications.
753 'ignore_ewmh_fullscreen'::
754 Block the fullscreen state transitions that originate from an EWMH request. The possible values are: *none*, *all*, or a comma separated list of the following values: *enter*, *exit*.
756 'ignore_ewmh_struts'::
757 BIgnore strut hinting from clients requesting to reserve space (i.e. task bars).
759 'center_pseudo_tiled'::
760 Center pseudo tiled windows into their tiling rectangles. Defaults to 'true'.
763 Apply ICCCM window size hints.
765 'remove_disabled_monitors'::
766 Consider disabled monitors as disconnected.
768 'remove_unplugged_monitors'::
769 Remove unplugged monitors.
771 'merge_overlapping_monitors'::
772 Merge overlapping monitors (the bigger remains).
774 Monitor and Desktop Settings
775 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
781 Padding space added at the sides of the monitor or desktop.
787 Size of the gap that separates windows.
799 Focus the window (or the monitor) under the pointer if the value isn't *none*.
801 'pointer_modifier' + 'button1'::
802 Move the window under the pointer.
804 'pointer_modifier' + 'button2'::
805 Resize the window under the pointer by dragging the nearest side.
807 'pointer_modifier' + 'button3'::
808 Resize the window under the pointer by dragging the nearest corner.
810 The behavior of 'pointer_modifier' + 'button<n>' can be modified through the 'pointer_action<n>' setting.
816 See the next section for the description of the format.
818 'monitor_add <monitor_id> <monitor_name> <monitor_geometry>'::
821 'monitor_rename <monitor_id> <old_name> <new_name>'::
822 A monitor is renamed.
824 'monitor_remove <monitor_id>'::
825 A monitor is removed.
827 'monitor_swap <src_monitor_id> <dst_monitor_id>'::
828 A monitor is swapped.
830 'monitor_focus <monitor_id>'::
831 A monitor is focused.
833 'monitor_geometry <monitor_id> <monitor_geometry>'::
834 The geometry of a monitor changed.
836 'desktop_add <monitor_id> <desktop_id> <desktop_name>'::
839 'desktop_rename <monitor_id> <desktop_id> <old_name> <new_name>'::
840 A desktop is renamed.
842 'desktop_remove <monitor_id> <desktop_id>'::
843 A desktop is removed.
845 'desktop_swap <src_monitor_id> <src_desktop_id> <dst_monitor_id> <dst_desktop_id>'::
846 A desktop is swapped.
848 'desktop_transfer <src_monitor_id> <src_desktop_id> <dst_monitor_id>'::
849 A desktop is transferred.
851 'desktop_focus <monitor_id> <desktop_id>'::
852 A desktop is focused.
854 'desktop_activate <monitor_id> <desktop_id>'::
855 A desktop is activated.
857 'desktop_layout <monitor_id> <desktop_id> tiled|monocle'::
858 The layout of a desktop changed.
860 'node_add <monitor_id> <desktop_id> <ip_id> <node_id>'::
863 'node_remove <monitor_id> <desktop_id> <node_id>'::
866 'node_swap <src_monitor_id> <src_desktop_id> <src_node_id> <dst_monitor_id> <dst_desktop_id> <dst_node_id>'::
869 'node_transfer <src_monitor_id> <src_desktop_id> <src_node_id> <dst_monitor_id> <dst_desktop_id> <dst_node_id>'::
870 A node is transferred.
872 'node_focus <monitor_id> <desktop_id> <node_id>'::
875 'node_activate <monitor_id> <desktop_id> <node_id>'::
878 'node_presel <monitor_id> <desktop_id> <node_id> (dir DIR|ratio RATIO|cancel)'::
879 A node is preselected.
881 'node_stack <node_id_1> below|above <node_id_2>'::
882 A node is stacked below or above another node.
884 'node_geometry <monitor_id> <desktop_id> <node_id> <node_geometry>'::
885 The geometry of a window changed.
887 'node_state <monitor_id> <desktop_id> <node_id> tiled|pseudo_tiled|floating|fullscreen on|off'::
888 The state of a window changed.
890 'node_flag <monitor_id> <desktop_id> <node_id> hidden|sticky|private|locked|marked|urgent on|off'::
891 One of the flags of a node changed.
893 'node_layer <monitor_id> <desktop_id> <node_id> below|normal|above'::
894 The layer of a window changed.
896 'pointer_action <monitor_id> <desktop_id> <node_id> move|resize_corner|resize_side begin|end'::
897 A pointer action occured.
899 Please note that *bspwm* initializes monitors before it reads messages on its socket, therefore the initial monitor events can't be received.
904 Each report event message is composed of items separated by colons.
906 Each item has the form '<type><value>' where '<type>' is the first character of the item.
915 Occupied focused desktop.
918 Occupied unfocused desktop.
921 Free focused desktop.
924 Free unfocused desktop.
927 Urgent focused desktop.
930 Urgent unfocused desktop.
933 Layout of the focused desktop of a monitor.
936 State of the focused node of a focused desktop.
939 Active flags of the focused node of a focused desktop.
941 Environment Variables
942 ---------------------
945 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'.
950 * Steven Allen <steven at stebalien.com>
951 * Thomas Adam <thomas at xteddy.org>
952 * Ivan Kanakarakis <ivan.kanak at gmail.com>
957 Bastien Dejean <nihilhill at gmail.com>