Fixes #193.
_bspc() {
local commands='window desktop monitor query pointer rule restore control config quit'
- local settings='external_rules_command status_prefix focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color focused_sticky_border_color normal_sticky_border_color focused_private_border_color active_private_border_color normal_private_border_color urgent_border_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_focus pointer_follows_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus focus_by_distance ignore_ewmh_focus remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
+ local settings='external_rules_command status_prefix focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color focused_sticky_border_color normal_sticky_border_color focused_private_border_color active_private_border_color normal_private_border_color urgent_border_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio initial_polarity borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_focus pointer_follows_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus focus_by_distance ignore_ewmh_focus remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
COMPREPLY=()
_bspc() {
local -a commands settings
commands=('window' 'desktop' 'monitor' 'query' 'pointer' 'rule' 'restore' 'control' 'config' 'quit')
- settings=('external_rules_command' 'status_prefix' 'focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_border_color' 'focused_sticky_border_color' 'normal_sticky_border_color' 'focused_private_border_color' 'active_private_border_color' 'normal_private_border_color' 'urgent_border_color' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' 'borderless_monocle' 'gapless_monocle' 'focus_follows_pointer' 'pointer_follows_focus' 'pointer_follows_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'focus_by_distance' 'ignore_ewmh_focus' 'remove_disabled_monitors' 'remove_unplugged_monitors' 'merge_overlapping_monitors')
+ settings=('external_rules_command' 'status_prefix' 'focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_border_color' 'focused_sticky_border_color' 'normal_sticky_border_color' 'focused_private_border_color' 'active_private_border_color' 'normal_private_border_color' 'urgent_border_color' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' 'initial_polarity' 'borderless_monocle' 'gapless_monocle' 'focus_follows_pointer' 'pointer_follows_focus' 'pointer_follows_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'focus_by_distance' 'ignore_ewmh_focus' 'remove_disabled_monitors' 'remove_unplugged_monitors' 'merge_overlapping_monitors')
if (( CURRENT == 2 )) ; then
_values 'command' "$commands[@]"
elif (( CURRENT == 3 )) ; then
.\" Title: bspwm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 11/23/2014
+.\" Date: 01/06/2015
.\" Manual: Bspwm Manual
.\" Source: Bspwm 0.8.9
.\" Language: English
.\"
-.TH "BSPWM" "1" "11/23/2014" "Bspwm 0\&.8\&.9" "Bspwm Manual"
+.TH "BSPWM" "1" "01/06/2015" "Bspwm 0\&.8\&.9" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
command)\&.
.RE
.PP
+\fIinitial_polarity\fR
+.RS 4
+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:
+\fBfirst_child\fR,
+\fBsecond_child\fR\&.
+.RE
+.PP
\fIhistory_aware_focus\fR
.RS 4
Give priority to the focus history when focusing nodes\&.
'external_rules_command'::
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).
+'initial_polarity'::
+ 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*.
+
'history_aware_focus'::
Give priority to the focus history when focusing nodes.
SETCOLOR(normal_private_border_color)
SETCOLOR(urgent_border_color)
#undef SETCOLOR
+ } else if (streq("initial_polarity", name)) {
+ child_polarity_t p;
+ if (parse_child_polarity(value, &p)) {
+ initial_polarity = p;
+ } else {
+ return MSG_FAILURE;
+ }
} else if (streq("focus_follows_pointer", name)) {
bool b;
if (parse_bool(value, &b) && b != focus_follows_pointer) {
fprintf(rsp, "%s", external_rules_command);
else if (streq("status_prefix", name))
fprintf(rsp, "%s", status_prefix);
+ else if (streq("initial_polarity", name))
+ fprintf(rsp, "%s", initial_polarity == FIRST_CHILD ? "first_child" : "second_child");
#define MONDESKGET(k) \
else if (streq(#k, name)) \
if (loc.desktop != NULL) \
return false;
}
+bool parse_child_polarity(char *s, child_polarity_t *p)
+{
+ if (streq("first_child", s)) {
+ *p = FIRST_CHILD;
+ return true;
+ } else if (streq("second_child", s)) {
+ *p = SECOND_CHILD;
+ return true;
+ }
+ return false;
+}
+
bool parse_degree(char *s, int *d)
{
int i = atoi(s);
bool parse_history_direction(char *s, history_dir_t *d);
bool parse_flip(char *s, flip_t *f);
bool parse_pointer_action(char *s, pointer_action_t *a);
+bool parse_child_polarity(char *s, child_polarity_t *p);
bool parse_degree(char *s, int *d);
bool parse_window_id(char *s, long int *i);
bool parse_bool_declaration(char *s, char **key, bool *value, alter_state_t *state);
split_ratio = SPLIT_RATIO;
window_gap = WINDOW_GAP;
border_width = BORDER_WIDTH;
+ initial_polarity = FIRST_CHILD;
borderless_monocle = BORDERLESS_MONOCLE;
gapless_monocle = GAPLESS_MONOCLE;
double split_ratio;
int window_gap;
unsigned int border_width;
+child_polarity_t initial_polarity;
bool borderless_monocle;
bool gapless_monocle;
switch (f->split_mode) {
case MODE_AUTOMATIC:
if (p == NULL) {
- c->first_child = n;
- c->second_child = f;
+ if (initial_polarity == FIRST_CHILD) {
+ c->first_child = n;
+ c->second_child = f;
+ } else {
+ c->first_child = f;
+ c->second_child = n;
+ }
if (m->rectangle.width > m->rectangle.height)
c->split_type = TYPE_VERTICAL;
else
DESKTOP_URGENCY_OFF
} desktop_urgency_t;
+typedef enum {
+ FIRST_CHILD,
+ SECOND_CHILD
+} child_polarity_t;
+
typedef struct {
desktop_status_t status;
bool urgent;