]> git.lizzy.rs Git - bspwm.git/blobdiff - contrib/zsh_completion
Add new setting: cancel_birth_rotation
[bspwm.git] / contrib / zsh_completion
index 079261bd28aa366c116450c5cff9a2081fa3c5db..711833b754d3c05e96a7cfeb74c1d9bed7f0a0ea 100644 (file)
@@ -126,20 +126,20 @@ _bspc_query_names() {
 }
 
 _bspc() {
-       local -a commands \
-               commands=(node desktop monitor query rule wm subscribe config quit) \
+       local -a commands=(node desktop monitor query rule wm subscribe config quit) \
+               resize_handle=(top bottom top_left top_right bottom_left bottom_right left right) \
                node_state=(tiled pseudo_tiled floating fullscreen) \
-               flag=(hidden sticky private locked urgent) \
+               flag=(hidden sticky private locked marked urgent) \
                layer=(below normal above) \
                dir=(north west south east) \
                cycle_dir=(next prev)
        local -a jump=($dir first second brother parent 1 2) \
-               node_desc=($dir $cycle_dir last older newer focused pointed biggest) \
+               node_desc=($dir $cycle_dir any last newest older newer focused pointed biggest smallest) \
                node_mod=($node_state $flag $layer focused automatic local \
                active leaf window same_class descendant_of ancestor_of) \
-               desktop_desc=($cycle_dir last older newer focused) \
+               desktop_desc=($cycle_dir any last newest older newer focused) \
                desktop_mod=(focused occupied local urgent) \
-               monitor_desc=($dir $cycle_dir primary last older newer focused pointed) \
+               monitor_desc=($dir $cycle_dir any last newest older newer focused pointed primary) \
                monitor_mod=(focused occupied) \
                presel_dir=($dir cancel)
        local quote="${compstate[quote]}" context state state_descr line
@@ -157,41 +157,38 @@ _bspc() {
                (node)
                        ((CURRENT==2)) && _bspc_selector node
                        ((CURRENT>2)) && [[ "$words[2]" != '-'* ]] && compset -n 2
-                       while do
-                               _arguments -C \
-                                       '*'{-a,--activate}'[Activate the selected or given node]::node selector:_bspc_selector -- node'\
-                                       '*'{-B,--balance}'[Adjust the split ratios of the tree rooted at the selected node so that all windows occupy the same area]'\
-                                       '*'{-C,--circulate}'[Circulate the windows of the tree rooted at the selected node]:direction:(forward backward)'\
-                                       '*'{-c,--close}'[Close the windows rooted at the selected node]'\
-                                       '*'{-d,--to-desktop}'[Send the selected node to the given desktop]:desktop selector:_bspc_selector -- desktop'\
-                                       '*'{-E,--equalize}'[Reset the split ratios of the tree rooted at the selected node to their default value]'\
-                                       '*'{-F,--flip}'[Flip the the tree rooted at selected node]: :(horizontal vertical)'\
-                                       '*'{-f,--focus}'[Focus the selected or given node]::node selector:_bspc_selector -- node'\
-                                       '*'{-g,--flag}'[Set or toggle the given flag for the selected node]: :->flag'\
-                                       '*'{-i,--insert-receptacle}'[Insert a receptacle node at the selected node]'\
-                                       '*'{-k,--kill}'[Kill the windows rooted at the selected node]'\
-                                       '*'{-l,--layer}"[Set the stacking layer of the selected window]:stacking layer:($layer)"\
-                                       '*'{-m,--to-monitor}'[Send the selected node to the given monitor]:monitor selector:_bspc_selector -- monitor'\
-                                       '*'{-n,--to-node}'[Transplant the selected node to the given node]:node selector:_bspc_selector -- node'\
-                                       '*'{-o,--presel-ratio}'[Set the splitting ratio of the preselection area]:preselect ratio: ( )'\
-                                       '*'{-p,--presel-dir}'[Preselect the splitting area of the selected node or cancel the preselection]: :_bspc_prefix -- "~" preselect presel_dir'\
-                                       '*'{-r,--ratio}'[Set the splitting ratio of the selected node (0 < ratio < 1)]: :( )'\
-                                       '*'{-R,--rotate}'[Rotate the tree rooted at the selected node]:angle:(90 270 180)'\
-                                       '*'{-s,--swap}'[Swap the selected node with the given node]:node selector:_bspc_selector -- node'\
-                                       '*'{-t,--state}'[Set the state of the selected window]: :_bspc_prefix -- "~" "node state" node_state '\
-                                       '*'{-v,--move}'[Move the selected window by dx pixels horizontally and dy pixels vertically]:dx dy:'\
-                                       '*'{-z,--resize}'[Resize the selected window by moving the given handle by dx pixels horizontally and dy pixels vertically]:*::: :->resize'
-                               [ "$state" = flag ] && _values 'flag' "${flag[@]:#urgent}::set flag:(on off)"
-                               [ "$state" = resize ] || break
-                               ((CURRENT == 1)) &&
-                                       _values 'handle' resize_handle {top,bottom}{,_left,_right} left right
-                               ((CURRENT <= 3)) && break
-                               compset -n 3
-                       done
+                       ((CURRENT>2)) && [[ "$words[CURRENT-2]" =~ "^-(m|d|n|s|-to-(monitor|desktop|node)|-swap)$" ]] &&
+                               _values 'option' '--follow[If passed, the focused node will stay focused]'
+                       _arguments -C \
+                               '*'{-a,--activate}'[Activate the selected or given node]::node selector:_bspc_selector -- node'\
+                               '*'{-B,--balance}'[Adjust the split ratios of the tree rooted at the selected node so that all windows occupy the same area]'\
+                               '*'{-C,--circulate}'[Circulate the windows of the tree rooted at the selected node]:direction:(forward backward)'\
+                               '*'{-c,--close}'[Close the windows rooted at the selected node]'\
+                               '*'{-d,--to-desktop}'[Send the selected node to the given desktop]:desktop selector:_bspc_selector -- desktop'\
+                               '*'{-E,--equalize}'[Reset the split ratios of the tree rooted at the selected node to their default value]'\
+                               '*'{-F,--flip}'[Flip the the tree rooted at selected node]: :(horizontal vertical)'\
+                               '*'{-f,--focus}'[Focus the selected or given node]::node selector:_bspc_selector -- node'\
+                               '*'{-g,--flag}'[Set or toggle the given flag for the selected node]: :-> flag'\
+                               '*'{-i,--insert-receptacle}'[Insert a receptacle node at the selected node]'\
+                               '*'{-k,--kill}'[Kill the windows rooted at the selected node]'\
+                               '*'{-l,--layer}"[Set the stacking layer of the selected window]:stacking layer:($layer)"\
+                               '*'{-m,--to-monitor}'[Send the selected node to the given monitor]:monitor selector:_bspc_selector -- monitor'\
+                               '*'{-n,--to-node}'[Transplant the selected node to the given node]:node selector:_bspc_selector -- node'\
+                               '*'{-o,--presel-ratio}'[Set the splitting ratio of the preselection area]:preselect ratio: ( )'\
+                               '*'{-p,--presel-dir}'[Preselect the splitting area of the selected node or cancel the preselection]: :_bspc_prefix -- "~" preselect presel_dir'\
+                               '*'{-r,--ratio}'[Set the splitting ratio of the selected node (0 < ratio < 1)]: :( )'\
+                               '*'{-R,--rotate}'[Rotate the tree rooted at the selected node]:angle:(90 270 180)'\
+                               '*'{-s,--swap}'[Swap the selected node with the given node]:node selector:_bspc_selector -- node'\
+                               '*'{-t,--state}'[Set the state of the selected window]: :_bspc_prefix -- "~" "node state" node_state '\
+                               '*'{-v,--move}'[Move the selected window by dx pixels horizontally and dy pixels vertically]:dx:( ):dy:( )'\
+                               '*'{-z,--resize}"[Resize the selected window by moving the given handle by dx pixels horizontally and dy pixels vertically]:handle:($resize_handle):dx:( ):dy:( )"
+                       [ "$state" = flag ] && _values 'flag' "${flag[@]:#urgent}::set flag:(on off)"
                        ;;
                (desktop)
                        ((CURRENT==2)) && _bspc_selector desktop
                        ((CURRENT>2)) && [[ "$words[2]" != '-'* ]] && compset -n 2
+                       ((CURRENT>2)) && [[ "$words[CURRENT-2]" =~ "^-m|-s|--monitor|--swap$" ]] &&
+                               _values 'option' '--follow[If passed, the focused desktop will stay focused]'
                        _arguments \
                                '*'{-a,--activate}'[Activate the selected or given desktop]:: :_bspc_selector -- desktop'\
                                '*'{-b,--bubble}"[Bubble the selected desktop in the given direction]:direction:($cycle_dir)"\
@@ -318,7 +315,7 @@ _bspc() {
                        local -a look behaviour input
                        # Boolean settings are identified by index!
                        look=(borderless_monocle gapless_monocle {normal,active,focused}_border_color {top,right,bottom,left}_padding presel_feedback_color border_width window_gap)
-                       behaviour=(single_monocle ignore_ewmh_focus center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors status_prefix external_rules_command split_ratio initial_polarity directional_focus_tightness status_prefix)
+                       behaviour=(single_monocle mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen center_pseudo_tiled honor_size_hints cancel_birth_rotation remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors status_prefix external_rules_command split_ratio initial_polarity directional_focus_tightness status_prefix)
                        input=({swallow_first_click,focus_follows_pointer,pointer_follows_{focus,monitor}} click_to_focus pointer_motion_interval pointer_modifier pointer_action{1,2,3} )
                        if [[ "$CURRENT" == (2|3) ]];then
                                _arguments \