mirror of
https://github.com/vale981/bspwm
synced 2025-03-04 17:31:39 -05:00
New setting: leaf_monocle
Use monocle layout if there is a single node.
This commit is contained in:
parent
dccb5e7be2
commit
51e09ea11e
8 changed files with 23 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
_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 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 center_pseudo_tiled 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 leaf_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 center_pseudo_tiled remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
|
||||
|
||||
COMPREPLY=()
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
_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' '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' 'center_pseudo_tiled' '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' 'leaf_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' 'center_pseudo_tiled' 'remove_disabled_monitors' 'remove_unplugged_monitors' 'merge_overlapping_monitors')
|
||||
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: 05/26/2015
|
||||
.\" Date: 08/05/2015
|
||||
.\" Manual: Bspwm Manual
|
||||
.\" Source: Bspwm 0.9
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "BSPWM" "1" "05/26/2015" "Bspwm 0\&.9" "Bspwm Manual"
|
||||
.TH "BSPWM" "1" "08/05/2015" "Bspwm 0\&.9" "Bspwm Manual"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
|
@ -1093,6 +1093,11 @@ Remove borders for tiled windows in monocle mode\&.
|
|||
Remove gaps for tiled windows in monocle mode\&.
|
||||
.RE
|
||||
.PP
|
||||
\fIleaf_monocle\fR
|
||||
.RS 4
|
||||
Use monocle layout if there is a single node\&.
|
||||
.RE
|
||||
.PP
|
||||
\fIfocus_follows_pointer\fR
|
||||
.RS 4
|
||||
Focus the window under the pointer\&.
|
||||
|
|
|
@ -670,6 +670,9 @@ Global Settings
|
|||
'gapless_monocle'::
|
||||
Remove gaps for tiled windows in monocle mode.
|
||||
|
||||
'leaf_monocle'::
|
||||
Use monocle layout if there is a single node.
|
||||
|
||||
'focus_follows_pointer'::
|
||||
Focus the window under the pointer.
|
||||
|
||||
|
|
|
@ -1044,6 +1044,7 @@ int set_setting(coordinates_t loc, char *name, char *value)
|
|||
return MSG_FAILURE;
|
||||
SETBOOL(borderless_monocle)
|
||||
SETBOOL(gapless_monocle)
|
||||
SETBOOL(leaf_monocle)
|
||||
SETBOOL(pointer_follows_focus)
|
||||
SETBOOL(pointer_follows_monitor)
|
||||
SETBOOL(apply_floating_atom)
|
||||
|
@ -1130,6 +1131,7 @@ int get_setting(coordinates_t loc, char *name, FILE* rsp)
|
|||
fprintf(rsp, "%s", BOOLSTR(s));
|
||||
GETBOOL(borderless_monocle)
|
||||
GETBOOL(gapless_monocle)
|
||||
GETBOOL(leaf_monocle)
|
||||
GETBOOL(focus_follows_pointer)
|
||||
GETBOOL(pointer_follows_focus)
|
||||
GETBOOL(pointer_follows_monitor)
|
||||
|
|
|
@ -64,6 +64,7 @@ void load_settings(void)
|
|||
|
||||
borderless_monocle = BORDERLESS_MONOCLE;
|
||||
gapless_monocle = GAPLESS_MONOCLE;
|
||||
leaf_monocle = LEAF_MONOCLE;
|
||||
focus_follows_pointer = FOCUS_FOLLOWS_POINTER;
|
||||
pointer_follows_focus = POINTER_FOLLOWS_FOCUS;
|
||||
pointer_follows_monitor = POINTER_FOLLOWS_MONITOR;
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#define FOCUS_BY_DISTANCE false
|
||||
#define BORDERLESS_MONOCLE false
|
||||
#define GAPLESS_MONOCLE false
|
||||
#define LEAF_MONOCLE false
|
||||
#define FOCUS_FOLLOWS_POINTER false
|
||||
#define POINTER_FOLLOWS_FOCUS false
|
||||
#define POINTER_FOLLOWS_MONITOR false
|
||||
|
@ -93,6 +94,7 @@ child_polarity_t initial_polarity;
|
|||
|
||||
bool borderless_monocle;
|
||||
bool gapless_monocle;
|
||||
bool leaf_monocle;
|
||||
bool focus_follows_pointer;
|
||||
bool pointer_follows_focus;
|
||||
bool pointer_follows_monitor;
|
||||
|
|
6
tree.c
6
tree.c
|
@ -43,6 +43,10 @@ void arrange(monitor_t *m, desktop_t *d)
|
|||
|
||||
PRINTF("arrange %s %s\n", m->name, d->name);
|
||||
|
||||
layout_t set_layout = d->layout;
|
||||
if (leaf_monocle && is_leaf(d->root))
|
||||
d->layout = LAYOUT_MONOCLE;
|
||||
|
||||
xcb_rectangle_t rect = m->rectangle;
|
||||
int wg = (gapless_monocle && d->layout == LAYOUT_MONOCLE ? 0 : d->window_gap);
|
||||
rect.x += m->left_padding + d->left_padding + wg;
|
||||
|
@ -50,6 +54,8 @@ void arrange(monitor_t *m, desktop_t *d)
|
|||
rect.width -= m->left_padding + d->left_padding + d->right_padding + m->right_padding + wg;
|
||||
rect.height -= m->top_padding + d->top_padding + d->bottom_padding + m->bottom_padding + wg;
|
||||
apply_layout(m, d, d->root, rect, rect);
|
||||
|
||||
d->layout = set_layout;
|
||||
}
|
||||
|
||||
void apply_layout(monitor_t *m, desktop_t *d, node_t *n, xcb_rectangle_t rect, xcb_rectangle_t root_rect)
|
||||
|
|
Loading…
Add table
Reference in a new issue