Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option record_history #917

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/bash_completion
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_bspc() {
local commands='node desktop monitor query rule wm subscribe config quit'

local settings='external_rules_command status_prefix normal_border_color active_border_color focused_border_color presel_feedback_color border_width window_gap top_padding right_padding bottom_padding left_padding top_monocle_padding right_monocle_padding bottom_monocle_padding left_monocle_padding split_ratio automatic_scheme removal_adjustment initial_polarity directional_focus_tightness presel_feedback borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus swallow_first_click focus_follows_pointer pointer_follows_focus pointer_follows_monitor mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen ignore_ewmh_struts center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
local settings='external_rules_command status_prefix normal_border_color active_border_color focused_border_color presel_feedback_color border_width window_gap top_padding right_padding bottom_padding left_padding top_monocle_padding right_monocle_padding bottom_monocle_padding left_monocle_padding split_ratio automatic_scheme removal_adjustment initial_polarity directional_focus_tightness presel_feedback borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus swallow_first_click focus_follows_pointer pointer_follows_focus pointer_follows_monitor mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen ignore_ewmh_struts center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors record_history'

COMPREPLY=()

Expand Down
2 changes: 1 addition & 1 deletion contrib/fish_completion
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ function __fish_bspc_using_command
end

complete -f -c bspc -n '__fish_bspc_needs_command' -a 'node desktop monitor query rule wm subscribe config quit'
complete -f -c bspc -n '__fish_bspc_using_command config' -a 'external_rules_command status_prefix normal_border_color active_border_color focused_border_color presel_feedback_color border_width window_gap top_padding right_padding bottom_padding left_padding top_monocle_padding right_monocle_padding bottom_monocle_padding left_monocle_padding split_ratio automatic_scheme removal_adjustment initial_polarity directional_focus_tightness presel_feedback borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus swallow_first_click focus_follows_pointer pointer_follows_focus pointer_follows_monitor mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen ignore_ewmh_struts center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
complete -f -c bspc -n '__fish_bspc_using_command config' -a 'external_rules_command status_prefix normal_border_color active_border_color focused_border_color presel_feedback_color border_width window_gap top_padding right_padding bottom_padding left_padding top_monocle_padding right_monocle_padding bottom_monocle_padding left_monocle_padding split_ratio automatic_scheme removal_adjustment initial_polarity directional_focus_tightness presel_feedback borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus swallow_first_click focus_follows_pointer pointer_follows_focus pointer_follows_monitor mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen ignore_ewmh_struts center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors record_history'
2 changes: 1 addition & 1 deletion contrib/zsh_completion
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ _bspc() {
local -a {look,behaviour,input}{_bool,}
look_bool=(presel_feedback borderless_monocle gapless_monocle)
look=({normal,active,focused}_border_color {top,right,bottom,left}_padding {top,right,bottom,left}_monocle_padding presel_feedback_color border_width window_gap)
behaviour_bool=(single_monocle removal_adjustment ignore_ewmh_focus ignore_ewmh_struts center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors)
behaviour_bool=(single_monocle removal_adjustment ignore_ewmh_focus ignore_ewmh_struts center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors record_history)
behaviour=(mapping_events_count ignore_ewmh_fullscreen external_rules_command split_ratio automatic_scheme initial_polarity directional_focus_tightness status_prefix)
input_bool=(swallow_first_click focus_follows_pointer pointer_follows_{focus,monitor})
input=(click_to_focus pointer_motion_interval pointer_modifier pointer_action{1,2,3})
Expand Down
11 changes: 8 additions & 3 deletions doc/bspwm.1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/29/2019
.\" Manual: Bspwm Manual
.\" Source: Bspwm 0.9.5-35-g32ff624
.\" Source: Bspwm 0.9.5-38-gba5cafc
.\" Language: English
.\"
.TH "BSPWM" "1" "01/29/2019" "Bspwm 0\&.9\&.5\-35\-g32ff624" "Bspwm Manual"
.TH "BSPWM" "1" "01/29/2019" "Bspwm 0\&.9\&.5\-38\-gba5cafc" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
Expand Down Expand Up @@ -992,7 +992,7 @@ Manage all the unmanaged windows remaining from a previous session\&.
.PP
\fB\-h\fR, \fB\-\-record\-history\fR on|off
.RS 4
Enable or disable the recording of node focus history\&.
Copy link
Contributor

@emanuele6 emanuele6 Sep 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should edit the asciidoc file, not the man page directly: this change will be overwritten when the man page is recompiled with make doc.

Enable or disable the record_history config option
.RE
.PP
\fB\-g\fR, \fB\-\-get\-status\fR
Expand Down Expand Up @@ -1336,6 +1336,11 @@ Remove unplugged monitors\&.
.RS 4
Merge overlapping monitors (the bigger remains)\&.
.RE
.PP
\fIrecord_history\fR
.RS 4
Enable or disable the recording of node focus history\&.
.RE
.SS "Monitor and Desktop Settings"
.PP
\fItop_padding\fR, \fIright_padding\fR, \fIbottom_padding\fR, \fIleft_padding\fR
Expand Down
5 changes: 4 additions & 1 deletion doc/bspwm.1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ Commands
Manage all the unmanaged windows remaining from a previous session.

*-h*, *--record-history* on|off::
Enable or disable the recording of node focus history.
Enable or disable the record_history config option

*-g*, *--get-status*::
Print the current status information.
Expand Down Expand Up @@ -765,6 +765,9 @@ Global Settings
'merge_overlapping_monitors'::
Merge overlapping monitors (the bigger remains).

'record_history'::
Enable or disable the recording of node focus history.

Monitor and Desktop Settings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
10 changes: 6 additions & 4 deletions src/messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,8 @@ void cmd_wm(char **args, int num, FILE *rsp)
return;
}

coordinates_t trg = {NULL, NULL, NULL};

while (num > 0) {
if (streq("-d", *args) || streq("--dump-state", *args)) {
query_tree(rsp);
Expand Down Expand Up @@ -1252,10 +1254,8 @@ void cmd_wm(char **args, int num, FILE *rsp)
if (num < 1) {
fail(rsp, "wm %s: Not enough arguments.\n", *(args - 1));
break;
}
bool b;
if (parse_bool(*args, &b)) {
record_history = b;
} else if (num == 1) {
set_setting(trg, "record_history", *args, rsp);
} else {
fail(rsp, "wm %s: Invalid argument: '%s'.\n", *(args - 1), *args);
break;
Expand Down Expand Up @@ -1679,6 +1679,7 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp)
SET_BOOL(center_pseudo_tiled)
SET_BOOL(honor_size_hints)
SET_BOOL(removal_adjustment)
SET_BOOL(record_history)
#undef SET_BOOL
#define SET_MON_BOOL(s) \
} else if (streq(#s, name)) { \
Expand Down Expand Up @@ -1812,6 +1813,7 @@ void get_setting(coordinates_t loc, char *name, FILE* rsp)
GET_BOOL(remove_disabled_monitors)
GET_BOOL(remove_unplugged_monitors)
GET_BOOL(merge_overlapping_monitors)
GET_BOOL(record_history)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are using spaces for indentation here

Suggested change
GET_BOOL(record_history)
GET_BOOL(record_history)

#undef GET_BOOL
} else {
fail(rsp, "config: Unknown setting: '%s'.\n", name);
Expand Down
2 changes: 2 additions & 0 deletions src/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,6 @@ void load_settings(void)
remove_disabled_monitors = REMOVE_DISABLED_MONITORS;
remove_unplugged_monitors = REMOVE_UNPLUGGED_MONITORS;
merge_overlapping_monitors = MERGE_OVERLAPPING_MONITORS;

record_history = RECORD_HISTORY;
}
1 change: 1 addition & 0 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#define REMOVE_DISABLED_MONITORS false
#define REMOVE_UNPLUGGED_MONITORS false
#define MERGE_OVERLAPPING_MONITORS false
#define RECORD_HISTORY true

char external_rules_command[MAXLEN];
char status_prefix[MAXLEN];
Expand Down