diff --git a/contrib/bash_completion b/contrib/bash_completion index 059612c5..4e9fb6dd 100644 --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -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=() diff --git a/contrib/fish_completion b/contrib/fish_completion index c76cde5b..066a16e3 100644 --- a/contrib/fish_completion +++ b/contrib/fish_completion @@ -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' diff --git a/contrib/zsh_completion b/contrib/zsh_completion index 0638ac64..1f0331e1 100644 --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -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}) diff --git a/doc/bspwm.1 b/doc/bspwm.1 index 107d3067..160914b9 100644 --- a/doc/bspwm.1 +++ b/doc/bspwm.1 @@ -4,10 +4,10 @@ .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" 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 .\" ----------------------------------------------------------------- @@ -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\&. +Enable or disable the record_history config option .RE .PP \fB\-g\fR, \fB\-\-get\-status\fR @@ -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 diff --git a/doc/bspwm.1.asciidoc b/doc/bspwm.1.asciidoc index e9583998..9e3dd6e2 100644 --- a/doc/bspwm.1.asciidoc +++ b/doc/bspwm.1.asciidoc @@ -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. @@ -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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/messages.c b/src/messages.c index 99fd520c..aea8e41e 100644 --- a/src/messages.c +++ b/src/messages.c @@ -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); @@ -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; @@ -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)) { \ @@ -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) #undef GET_BOOL } else { fail(rsp, "config: Unknown setting: '%s'.\n", name); diff --git a/src/settings.c b/src/settings.c index 8dc7ef9d..48c62ace 100644 --- a/src/settings.c +++ b/src/settings.c @@ -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; } diff --git a/src/settings.h b/src/settings.h index 803b7e15..58696544 100644 --- a/src/settings.h +++ b/src/settings.h @@ -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];