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.
This commit is contained in:
Isaac Freund
2021-04-15 00:28:39 +02:00
parent 33fb7725c5
commit d08032d685
19 changed files with 919 additions and 734 deletions

View File

@ -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