mirror of
https://github.com/vale981/bspwm
synced 2025-03-05 09:51:38 -05:00
New setting: growth_factor
This commit is contained in:
parent
e60e87b12d
commit
c026b3baa1
9 changed files with 29 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
|||
_bspc() {
|
||||
local commands='window desktop monitor query pointer rule restore control config quit'
|
||||
|
||||
local settings='focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_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'
|
||||
local settings='focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_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'
|
||||
|
||||
COMPREPLY=()
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
_bspc() {
|
||||
local -a commands settings
|
||||
commands=('window' 'desktop' 'monitor' 'query' 'pointer' 'rule' 'restore' 'control' 'config' 'quit')
|
||||
settings=('focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_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')
|
||||
settings=('focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_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')
|
||||
if (( CURRENT == 2 )) ; then
|
||||
_values 'command' "$commands[@]"
|
||||
elif (( CURRENT == 3 )) ; then
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
.\" Title: bspwm
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
||||
.\" Date: 09/20/2013
|
||||
.\" Date: 09/23/2013
|
||||
.\" Manual: Bspwm Manual
|
||||
.\" Source: Bspwm 0.8
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "BSPWM" "1" "09/20/2013" "Bspwm 0\&.8" "Bspwm Manual"
|
||||
.TH "BSPWM" "1" "09/23/2013" "Bspwm 0\&.8" "Bspwm Manual"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
|
@ -904,6 +904,11 @@ Window border width\&.
|
|||
Default split ratio\&.
|
||||
.RE
|
||||
.PP
|
||||
\fIgrowth_factor\fR
|
||||
.RS 4
|
||||
Intensity of the growth involved in pulling or pushing an edge\&.
|
||||
.RE
|
||||
.PP
|
||||
\fIhistory_aware_focus\fR
|
||||
.RS 4
|
||||
Give priority to the focus history when focusing nodes\&.
|
||||
|
|
|
@ -555,6 +555,9 @@ Global Settings
|
|||
'split_ratio'::
|
||||
Default split ratio.
|
||||
|
||||
'growth_factor'::
|
||||
Intensity of the growth involved in pulling or pushing an edge.
|
||||
|
||||
'history_aware_focus'::
|
||||
Give priority to the focus history when focusing nodes.
|
||||
|
||||
|
|
16
messages.c
16
messages.c
|
@ -750,11 +750,19 @@ bool set_setting(coordinates_t loc, char *name, char *value)
|
|||
MONSET(left_padding)
|
||||
#undef MONSET
|
||||
} else if (streq("split_ratio", name)) {
|
||||
double rat;
|
||||
if (sscanf(value, "%lf", &rat) == 1 && rat > 0 && rat < 1)
|
||||
split_ratio = rat;
|
||||
double r;
|
||||
if (sscanf(value, "%lf", &r) == 1 && r > 0 && r < 1)
|
||||
split_ratio = r;
|
||||
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);
|
||||
|
@ -818,6 +826,8 @@ bool get_setting(coordinates_t loc, char *name, char* rsp)
|
|||
snprintf(rsp, BUFSIZ, "%u", border_width);
|
||||
else 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;
|
||||
|
|
|
@ -34,6 +34,7 @@ void load_settings(void)
|
|||
|
||||
border_width = BORDER_WIDTH;
|
||||
split_ratio = SPLIT_RATIO;
|
||||
growth_factor = GROWTH_FACTOR;
|
||||
|
||||
borderless_monocle = BORDERLESS_MONOCLE;
|
||||
gapless_monocle = GAPLESS_MONOCLE;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#define BORDER_WIDTH 1
|
||||
#define SPLIT_RATIO 0.5
|
||||
#define GROWTH_FACTOR 1.1
|
||||
|
||||
#define HISTORY_AWARE_FOCUS false
|
||||
#define BORDERLESS_MONOCLE false
|
||||
|
@ -39,6 +40,7 @@ char urgent_border_color[MAXLEN];
|
|||
|
||||
unsigned int border_width;
|
||||
double split_ratio;
|
||||
double growth_factor;
|
||||
|
||||
bool borderless_monocle;
|
||||
bool gapless_monocle;
|
||||
|
|
2
tree.c
2
tree.c
|
@ -330,7 +330,7 @@ bool is_second_child(node_t *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));
|
||||
(chg == CHANGE_INCREASE ? (1 / growth_factor) : growth_factor));
|
||||
}
|
||||
|
||||
void reset_mode(coordinates_t *loc)
|
||||
|
|
2
tree.h
2
tree.h
|
@ -1,8 +1,6 @@
|
|||
#ifndef _TREE_H
|
||||
#define _TREE_H
|
||||
|
||||
#define GROWTH_FACTOR 1.1
|
||||
|
||||
node_t *make_node(void);
|
||||
client_t *make_client(xcb_window_t);
|
||||
void arrange(monitor_t *, desktop_t *);
|
||||
|
|
Loading…
Add table
Reference in a new issue