_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 growth_factor borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus ignore_ewmh_focus remove_disabled_monitor'
+ 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_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus ignore_ewmh_focus remove_disabled_monitor'
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' 'growth_factor' 'borderless_monocle' 'gapless_monocle' 'focus_follows_pointer' 'pointer_follows_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'ignore_ewmh_focus' 'remove_disabled_monitor')
+ 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_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'ignore_ewmh_focus' 'remove_disabled_monitor')
if (( CURRENT == 2 )) ; then
_values 'command' "$commands[@]"
elif (( CURRENT == 3 )) ; then
< 1)\&.
.RE
.PP
-\fB\-e\fR, \fB\-\-edge\fR \fIDIR\fR \fIRATIO\fR|\(+-\fIPIXELS\fR|pull|push
+\fB\-e\fR, \fB\-\-edge\fR \fIDIR\fR \fIRATIO\fR|\(+-\fIPIXELS\fR
.RS 4
-Set and change the splitting ratio of (or pull, or push) the edge located in the given direction in relation to the selected window\&.
+Set or change the splitting ratio of the edge located in the given direction in relation to the selected window\&.
.RE
.PP
\fB\-R\fR, \fB\-\-rotate\fR \fIDIR\fR \fI90|270|180\fR
Default split ratio\&.
.RE
.PP
-\fIgrowth_factor\fR
-.RS 4
-Intensity of the growth involved in pulling or pushing an edge\&.
-.RE
-.PP
\fIstatus_prefix\fR
.RS 4
Prefix prepended to each of the status lines\&.
*-r*, *--ratio* 'RATIO'::
Set the splitting ratio of the selected window (0 < 'RATIO' < 1).
-*-e*, *--edge* 'DIR' 'RATIO'|±'PIXELS'|pull|push::
- Set and change the splitting ratio of (or pull, or push) the edge located in the given direction in relation to the selected window.
+*-e*, *--edge* 'DIR' 'RATIO'|±'PIXELS'::
+ Set or change the splitting ratio of the edge located in the given direction in relation to the selected window.
*-R*, *--rotate* 'DIR' '90|270|180'::
Rotate the tree holding the edge located in the given direction in relation to the selected window.
'split_ratio'::
Default split ratio.
-'growth_factor'::
- Intensity of the growth involved in pulling or pushing an edge.
-
'status_prefix'::
Prefix prepended to each of the status lines.
bspc {window -p cancel,desktop -c}
super + alt + {h,j,k,l}
- bspc window -e {left,down,up,right} push
+ bspc window -e {left -10,down +10,up -10,right +10}
super + alt + shift + {h,j,k,l}
- bspc window -e {right,up,down,left} pull
+ bspc window -e {right -10,up +10,down -10,left +10}
super + ctrl + {1-9}
bspc window -r 0.{1-9}
if (n == NULL)
return false;
num--, args++;
- fence_move_t fmo;
- if (parse_fence_move(*args, &fmo)) {
- move_fence(n, dir, fmo);
- } else {
- if ((*args)[0] == '+' || (*args)[0] == '-') {
- int pix;
- if (sscanf(*args, "%i", &pix) == 1) {
- int max = (n->split_type == TYPE_HORIZONTAL ? n->rectangle.height : n->rectangle.width);
- double rat = ((max * n->split_ratio) + pix) / max;
- if (rat > 0 && rat < 1)
- n->split_ratio = rat;
- else
- return false;
- } else {
- return false;
- }
- } else {
- double rat;
- if (sscanf(*args, "%lf", &rat) == 1 && rat > 0 && rat < 1)
+ if ((*args)[0] == '+' || (*args)[0] == '-') {
+ int pix;
+ if (sscanf(*args, "%i", &pix) == 1) {
+ int max = (n->split_type == TYPE_HORIZONTAL ? n->rectangle.height : n->rectangle.width);
+ double rat = ((max * n->split_ratio) + pix) / max;
+ if (rat > 0 && rat < 1)
n->split_ratio = rat;
else
return false;
+ } else {
+ return false;
}
+ } else {
+ double rat;
+ if (sscanf(*args, "%lf", &rat) == 1 && rat > 0 && rat < 1)
+ n->split_ratio = rat;
+ else
+ return false;
}
dirty = true;
} else if (streq("-r", *args) || streq("--ratio", *args)) {
else
return false;
return true;
- } else if (streq("growth_factor", name)) {
- double g;
- if (sscanf(value, "%lf", &g) == 1 && g > 1)
- growth_factor = g;
- else
- return false;
- return true;
#define SETCOLOR(s) \
} else if (streq(#s, name)) { \
snprintf(s, sizeof(s), "%s", value);
{
if (streq("split_ratio", name))
snprintf(rsp, BUFSIZ, "%lf", split_ratio);
- else if (streq("growth_factor", name))
- snprintf(rsp, BUFSIZ, "%lf", growth_factor);
else if (streq("window_gap", name))
if (loc.desktop == NULL)
return false;
return false;
}
-bool parse_fence_move(char *s, fence_move_t *m)
-{
- if (streq("push", s)) {
- *m = MOVE_PUSH;
- return true;
- } else if (streq("pull", s)) {
- *m = MOVE_PULL;
- return true;
- }
- return false;
-}
-
bool parse_pointer_action(char *s, pointer_action_t *a)
{
if (streq("move", s)) {
bool parse_circulate_direction(char *s, circulate_dir_t *d);
bool parse_history_direction(char *s, history_dir_t *d);
bool parse_flip(char *s, flip_t *f);
-bool parse_fence_move(char *s, fence_move_t *m);
bool parse_pointer_action(char *s, pointer_action_t *a);
bool parse_degree(char *s, int *d);
bool parse_window_id(char *s, long int *i);
snprintf(urgent_border_color, sizeof(urgent_border_color), "%s", URGENT_BORDER_COLOR);
split_ratio = SPLIT_RATIO;
- growth_factor = GROWTH_FACTOR;
borderless_monocle = BORDERLESS_MONOCLE;
gapless_monocle = GAPLESS_MONOCLE;
#define URGENT_BORDER_COLOR "#EFA29A"
#define SPLIT_RATIO 0.5
-#define GROWTH_FACTOR 1.1
#define HISTORY_AWARE_FOCUS false
#define BORDERLESS_MONOCLE false
char urgent_border_color[MAXLEN];
double split_ratio;
-double growth_factor;
bool borderless_monocle;
bool gapless_monocle;
return (n != NULL && n->parent != NULL && n->parent->second_child == n);
}
-void change_split_ratio(node_t *n, value_change_t chg)
-{
- n->split_ratio = pow(n->split_ratio,
- (chg == CHANGE_INCREASE ? (1 / growth_factor) : growth_factor));
-}
-
void reset_mode(coordinates_t *loc)
{
if (loc->node != NULL) {
return r;
}
-void move_fence(node_t *n, direction_t dir, fence_move_t mov)
-{
- if (n == NULL)
- return;
-
- if ((mov == MOVE_PUSH && (dir == DIR_RIGHT || dir == DIR_DOWN))
- || (mov == MOVE_PULL && (dir == DIR_LEFT || dir == DIR_UP)))
- change_split_ratio(n, CHANGE_INCREASE);
- else
- change_split_ratio(n, CHANGE_DECREASE);
-}
-
void rotate_tree(node_t *n, int deg)
{
if (n == NULL || is_leaf(n) || deg == 0)
bool is_floating(client_t *c);
bool is_first_child(node_t *n);
bool is_second_child(node_t *n);
-void change_split_ratio(node_t *n, value_change_t chg);
void reset_mode(coordinates_t *loc);
node_t *brother_tree(node_t *n);
void closest_public(desktop_t *d, node_t *n, node_t **closest, node_t **public);
void get_opposite(direction_t src, direction_t *dst);
int tiled_area(node_t *n);
node_t *find_biggest(monitor_t *m, desktop_t *d, node_t *n, client_select_t sel);
-void move_fence(node_t *n, direction_t dir, fence_move_t mov);
void rotate_tree(node_t *n, int deg);
void rotate_brother(node_t *n);
void unrotate_tree(node_t *n, int rot);
MODE_MANUAL
} split_mode_t;
-typedef enum {
- MOVE_PULL,
- MOVE_PUSH
-} fence_move_t;
-
-typedef enum {
- CHANGE_INCREASE,
- CHANGE_DECREASE
-} value_change_t;
-
typedef enum {
CLIENT_TYPE_ALL,
CLIENT_TYPE_FLOATING,