From 4fbd961311a3b76f60b7128c85f5b8be0cd91ce2 Mon Sep 17 00:00:00 2001 From: Bastien Dejean Date: Thu, 26 Nov 2015 20:13:05 +0100 Subject: [PATCH] Remove settings: auto_cancel and auto_alternate auto_cancel can be emulated with: super + ctrl + {h,j,k,l} dir={left,down,up,right}; \ cur=$(bspc query -T -w focused.!automatic | jshon -e splitDir -u 2>&-); \ [ "$dir" = "$cur" ] && dir=cancel; \ bspc window -p "$dir" and auto_alternate with: super + {_,alt + }{1-9,0} kind={desktop,monitor}; \ item="^{1-9,10}"; \ bspc query --"$kind"s --"$kind" "$\{item\}.focused" > /dev/null && item=last; \ bspc "$kind" -f "$item" --- contrib/bash_completion | 2 +- contrib/zsh_completion | 2 +- doc/bspwm.1 | 22 ---------------------- doc/bspwm.1.asciidoc | 6 ------ messages.c | 24 +++--------------------- settings.c | 2 -- settings.h | 4 ---- 7 files changed, 5 insertions(+), 57 deletions(-) diff --git a/contrib/bash_completion b/contrib/bash_completion index b3c8275..cfcdccb 100644 --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -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 leaf_monocle focus_follows_pointer pointer_follows_focus pointer_follows_monitor 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 history_aware_focus focus_by_distance ignore_ewmh_focus center_pseudo_tiled remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors' COMPREPLY=() diff --git a/contrib/zsh_completion b/contrib/zsh_completion index b2d0a49..4066b21 100644 --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -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' 'leaf_monocle' 'focus_follows_pointer' 'pointer_follows_focus' 'pointer_follows_monitor' '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' '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 diff --git a/doc/bspwm.1 b/doc/bspwm.1 index cee3823..de3825f 100644 --- a/doc/bspwm.1 +++ b/doc/bspwm.1 @@ -1060,28 +1060,6 @@ When focusing a window, put the pointer at its center\&. When focusing a monitor, put the pointer at its center\&. .RE .PP -\fIauto_alternate\fR -.RS 4 -Interpret consecutive identical -\fB\-\-focus\fR -arguments as the -\fBlast\fR -selector for the -\fBmonitor\fR -and -\fBdesktop\fR -commands\&. -.RE -.PP -\fIauto_cancel\fR -.RS 4 -Interpret consecutive identical -\fB\-\-presel\fR -arguments as -\fB\-\-cancel\-presel\fR -option\&. -.RE -.PP \fIignore_ewmh_focus\fR .RS 4 Ignore EWMH focus requests coming from applications\&. diff --git a/doc/bspwm.1.asciidoc b/doc/bspwm.1.asciidoc index 1b1bba0..d063887 100644 --- a/doc/bspwm.1.asciidoc +++ b/doc/bspwm.1.asciidoc @@ -629,12 +629,6 @@ Global Settings 'pointer_follows_monitor':: When focusing a monitor, put the pointer at its center. -'auto_alternate':: - Interpret consecutive identical *--focus* arguments as the *last* selector for the *monitor* and *desktop* commands. - -'auto_cancel':: - Interpret consecutive identical *--presel* arguments as *--cancel-presel* option. - 'ignore_ewmh_focus':: Ignore EWMH focus requests coming from applications. diff --git a/messages.c b/messages.c index 3c7a18c..6f33519 100644 --- a/messages.c +++ b/messages.c @@ -253,15 +253,9 @@ int cmd_window(char **args, int num) if (sscanf(*args, "%lf", &rat) != 1 || rat <= 0 || rat >= 1) return MSG_FAILURE; } - if (auto_cancel && trg.node->split_mode == MODE_MANUAL && - dir == trg.node->split_dir && - rat == trg.node->split_ratio) { - reset_mode(&trg); - } else { - trg.node->split_mode = MODE_MANUAL; - trg.node->split_dir = dir; - trg.node->split_ratio = rat; - } + trg.node->split_mode = MODE_MANUAL; + trg.node->split_dir = dir; + trg.node->split_ratio = rat; window_draw_border(trg.node, trg.desktop->focus == trg.node, mon == trg.monitor); } else { return MSG_FAILURE; @@ -387,10 +381,6 @@ int cmd_desktop(char **args, int num) if (!desktop_from_desc(*args, &trg, &dst)) return MSG_FAILURE; } - if (auto_alternate && dst.desktop == mon->desk) { - desktop_select_t sel = make_desktop_select(); - history_find_desktop(HISTORY_OLDER, &trg, &dst, sel); - } focus_node(dst.monitor, dst.desktop, dst.desktop->focus); } else if (streq("-m", *args) || streq("--to-monitor", *args)) { num--, args++; @@ -543,10 +533,6 @@ int cmd_monitor(char **args, int num) if (!monitor_from_desc(*args, &trg, &dst)) return MSG_FAILURE; } - if (auto_alternate && dst.monitor == mon) { - monitor_select_t sel = make_monitor_select(); - history_find_monitor(HISTORY_OLDER, &trg, &dst, sel); - } focus_node(dst.monitor, dst.monitor->desk, dst.monitor->desk->focus); } else if (streq("-d", *args) || streq("--reset-desktops", *args)) { num--, args++; @@ -1067,8 +1053,6 @@ int set_setting(coordinates_t loc, char *name, char *value) SET_BOOL(leaf_monocle) SET_BOOL(pointer_follows_focus) SET_BOOL(pointer_follows_monitor) - SET_BOOL(auto_alternate) - SET_BOOL(auto_cancel) SET_BOOL(history_aware_focus) SET_BOOL(focus_by_distance) SET_BOOL(ignore_ewmh_focus) @@ -1156,8 +1140,6 @@ int get_setting(coordinates_t loc, char *name, FILE* rsp) GET_BOOL(focus_follows_pointer) GET_BOOL(pointer_follows_focus) GET_BOOL(pointer_follows_monitor) - GET_BOOL(auto_alternate) - GET_BOOL(auto_cancel) GET_BOOL(history_aware_focus) GET_BOOL(focus_by_distance) GET_BOOL(ignore_ewmh_focus) diff --git a/settings.c b/settings.c index 9c36396..9330e62 100644 --- a/settings.c +++ b/settings.c @@ -68,8 +68,6 @@ void load_settings(void) focus_follows_pointer = FOCUS_FOLLOWS_POINTER; pointer_follows_focus = POINTER_FOLLOWS_FOCUS; pointer_follows_monitor = POINTER_FOLLOWS_MONITOR; - auto_alternate = AUTO_ALTERNATE; - auto_cancel = AUTO_CANCEL; history_aware_focus = HISTORY_AWARE_FOCUS; ignore_ewmh_focus = IGNORE_EWMH_FOCUS; center_pseudo_tiled = CENTER_PSEUDO_TILED; diff --git a/settings.h b/settings.h index b58dac8..f373076 100644 --- a/settings.h +++ b/settings.h @@ -60,8 +60,6 @@ #define FOCUS_FOLLOWS_POINTER false #define POINTER_FOLLOWS_FOCUS false #define POINTER_FOLLOWS_MONITOR false -#define AUTO_ALTERNATE false -#define AUTO_CANCEL false #define IGNORE_EWMH_FOCUS false #define CENTER_PSEUDO_TILED true #define REMOVE_DISABLED_MONITORS false @@ -97,8 +95,6 @@ bool leaf_monocle; bool focus_follows_pointer; bool pointer_follows_focus; bool pointer_follows_monitor; -bool auto_alternate; -bool auto_cancel; bool history_aware_focus; bool focus_by_distance; bool ignore_ewmh_focus; -- 2.44.0