completions: Add missing completions

Added:
  * close (bash)
  * focus-output args: up right down left (bash,fish,zsh)
  * send-to-output args: up right down left (bash,fish,zsh)
  * default-attach-mode (bash,fish)
  * output-attach-mode (bash,fish)
  Zsh only as I don't know how does it works in other shell and so
  it's still need to be done.
    * send-to-output flags: -current-tag
    * keyboard-layout flags: -rules -model -variant -options
    * [un]map-switch, lid -> close|open and tablet -> on|off

Fixed:
  * rule-add|list-rules actions, rename tag to tags (bash,fish,zsh)

Some descriptions probably need to be changed with new args like up,
right..
This commit is contained in:
Hugo Machet
2024-03-08 13:06:54 +01:00
committed by Isaac Freund
parent 4e48d68485
commit 81f5b970e6
3 changed files with 33 additions and 14 deletions

View File

@ -1,6 +1,6 @@
function __riverctl_completion ()
{
local rule_actions="float no-float ssd csd tag output position dimensions fullscreen no-fullscreen"
local rule_actions="float no-float ssd csd tags output position dimensions fullscreen no-fullscreen"
if [ "${COMP_CWORD}" -eq 1 ]
then
OPTS=" \
@ -10,6 +10,7 @@ function __riverctl_completion ()
keyboard-group-remove \
keyboard-layout \
keyboard-layout-file \
close \
exit \
focus-output \
focus-view \
@ -46,7 +47,8 @@ function __riverctl_completion ()
unmap \
unmap-pointer \
unmap-switch \
attach-mode \
default-attach-mode \
output-attach-mode \
background-color \
border-color-focused \
border-color-unfocused \
@ -61,16 +63,16 @@ function __riverctl_completion ()
elif [ "${COMP_CWORD}" -eq 2 ]
then
case "${COMP_WORDS[1]}" in
"focus-output"|"send-to-output") OPTS="next previous" ;;
"focus-output"|"send-to-output") OPTS="next previous up right down left" ;;
"focus-view"|"swap") OPTS="next previous up down left right" ;;
"input") OPTS="$(riverctl list-inputs | sed '/configured:/d')" ;;
"move"|"snap") OPTS="up down left right" ;;
"resize") OPTS="horizontal vertical" ;;
"rule-add"|"rule-del") OPTS="-app-id -title $rule_actions" ;;
"list-rules") OPTS="float ssd tag output position dimensions fullscreen" ;;
"list-rules") OPTS="float ssd tags output position dimensions fullscreen" ;;
"map") OPTS="-release -repeat -layout" ;;
"unmap") OPTS="-release" ;;
"attach-mode") OPTS="top bottom" ;;
"default-attach-mode"|"output-attach-mode") OPTS="top bottom above below after" ;;
"focus-follows-cursor") OPTS="disabled normal always" ;;
"set-cursor-warp") OPTS="disabled on-output-change on-focus-change" ;;
"hide-cursor") OPTS="timeout when-typing" ;;