From d08032d6850d28063c0715aa54b1c18e0d0b966d Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 15 Apr 2021 00:28:39 +0200 Subject: river-options: rework, bump to v2 Options are now all global but may be overridden per-output. If an output local value is requested but none has been set, the global value is provided instead. This makes for much better ergonomics when configuring layout related options in particular. --- completions/bash/riverctl | 4 ++-- completions/fish/riverctl.fish | 6 +++--- completions/zsh/_riverctl | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'completions') diff --git a/completions/bash/riverctl b/completions/bash/riverctl index e744cd1..4a34c03 100644 --- a/completions/bash/riverctl +++ b/completions/bash/riverctl @@ -45,6 +45,7 @@ function __riverctl_completion () declare-option \ get-option \ set-option \ + unset-option \ mod-option" COMPREPLY=($(compgen -W "${OPTS}" -- "${COMP_WORDS[1]}")) elif [ "${COMP_CWORD}" -eq 2 ] @@ -56,7 +57,7 @@ function __riverctl_completion () "map"|"unmap") OPTS="-release" ;; "attach-mode") OPTS="top bottom" ;; "focus-follows-cursor") OPTS="disabled normal strict" ;; - "declare-option"|"get-option"|"set-option"|"mod-option") OPTS="-output -focused-output" ;; + "get-option"|"set-option"|"unset-option"|"mod-option") OPTS="-output -focused-output" ;; *) return ;; esac COMPREPLY=($(compgen -W "${OPTS}" -- "${COMP_WORDS[2]}")) @@ -66,4 +67,3 @@ function __riverctl_completion () } complete -F __riverctl_completion riverctl - diff --git a/completions/fish/riverctl.fish b/completions/fish/riverctl.fish index 1bdfe61..281805a 100644 --- a/completions/fish/riverctl.fish +++ b/completions/fish/riverctl.fish @@ -1,6 +1,6 @@ function __fish_riverctl_complete_no_subcommand for i in (commandline -opc) - if contains -- $i close csd-filter-add exit float-filter-add focus-output focus-view layout mod-main-count mod-main-factor move resize snap send-to-output spawn swap toggle-float toggle-fullscreen zoom set-focused-tags set-view-tags toggle-focused-tags toggle-view-tags spawn-tagmask declare-mode enter-mode map map-pointer unmap unmap-pointer attach-mode background-color border-color-focused border-color-unfocused border-width focus-follows-cursor opacity outer-padding set-repeat view-padding xcursor-theme declare-option get-option set-option mod-option output_title + if contains -- $i close csd-filter-add exit float-filter-add focus-output focus-view layout mod-main-count mod-main-factor move resize snap send-to-output spawn swap toggle-float toggle-fullscreen zoom set-focused-tags set-view-tags toggle-focused-tags toggle-view-tags spawn-tagmask declare-mode enter-mode map map-pointer unmap unmap-pointer attach-mode background-color border-color-focused border-color-unfocused border-width focus-follows-cursor opacity outer-padding set-repeat view-padding xcursor-theme declare-option get-option set-option unset-option mod-option output_title return 1 end end @@ -55,6 +55,7 @@ complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a xcursor-t complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a declare-option -d 'Declare a new option with the given type and initial value' complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a get-option -d 'Print the current value of the given option to stdout' complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a set-option -d 'Set the value of the specified option' +complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a unset-option -d 'Unset the value of the specified option for the given output' complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a mod-option -d 'Add value to the value of the specified option' complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a output_title -d 'Changing this option changes the title of the Wayland and X11 backend outputs' @@ -71,8 +72,7 @@ complete -c riverctl -x -n '__fish_seen_subcommand_from map' -a complete -c riverctl -x -n '__fish_seen_subcommand_from unmap' -a '-release' complete -c riverctl -x -n '__fish_seen_subcommand_from attach-mode' -a 'top bottom' complete -c riverctl -x -n '__fish_seen_subcommand_from focus-follows-cursor' -a 'disabled normal strict' -complete -c riverctl -x -n '__fish_seen_subcommand_from declare-option' -a '-output -focused-output' complete -c riverctl -x -n '__fish_seen_subcommand_from get-option' -a '-output -focused-output' complete -c riverctl -x -n '__fish_seen_subcommand_from set-option' -a '-output -focused-output' +complete -c riverctl -x -n '__fish_seen_subcommand_from unset-option' -a '-output -focused-output' complete -c riverctl -x -n '__fish_seen_subcommand_from mod-option' -a '-output -focused-output' - diff --git a/completions/zsh/_riverctl b/completions/zsh/_riverctl index 76918f5..23a706b 100644 --- a/completions/zsh/_riverctl +++ b/completions/zsh/_riverctl @@ -61,6 +61,7 @@ _riverctl() { 'declare-option:Declare a new option with the given type and initial value' 'get-option:Print the current value of the given option to stdout' 'set-option:Set the value of the specified option' + 'unset-option:Unset the value of the specified option for the given output' 'mod-option:Add value to the value of the specified option' 'output_title:Changing this option changes the title of the Wayland and X11 backend outputs' ) @@ -87,13 +88,12 @@ _riverctl() { unmap) _alternative 'arguments:optional:(-release)' ;; attach-mode) _attach ;; focus-follows-cursor) _focus_cursor ;; - declare-option) _river_opts ;; get-option) _river_opts ;; set-option) _river_opts ;; + unset-option) _river_opts ;; mod-option) _river_opts ;; *) return 0 ;; esac return 1 } - -- cgit v1.2.3