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

@ -60,7 +60,8 @@ complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'rule-add'
complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'rule-del' -d 'Delete a rule added with rule-add'
complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'list-rules' -d 'Print rules in a given list'
# Configuration
complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'attach-mode' -d 'Configure where new views should attach to the view stack'
complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'default-attach-mode' -d 'Set the attach mode to be used by all outputs by default'
complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'output-attach-mode' -d 'Set the attach mode of the currently focused output'
complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'background-color' -d 'Set the background color'
complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'border-color-focused' -d 'Set the border color of focused views'
complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'border-color-unfocused' -d 'Set the border color of unfocused views'
@ -80,19 +81,20 @@ complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'keyboard-layout'
complete -c riverctl -n '__fish_riverctl_complete_arg 1' -a 'keyboard-layout-file' -d 'Set the keyboard layout from a file.'
# Subcommands
complete -c riverctl -n '__fish_seen_subcommand_from focus-output send-to-output' -n '__fish_riverctl_complete_arg 2' -a 'next previous'
complete -c riverctl -n '__fish_seen_subcommand_from focus-output send-to-output' -n '__fish_riverctl_complete_arg 2' -a 'next previous up right down left'
complete -c riverctl -n '__fish_seen_subcommand_from focus-view swap' -n '__fish_riverctl_complete_arg 2' -a 'next previous up down left right'
complete -c riverctl -n '__fish_seen_subcommand_from move snap' -n '__fish_riverctl_complete_arg 2' -a 'up down left right'
complete -c riverctl -n '__fish_seen_subcommand_from resize' -n '__fish_riverctl_complete_arg 2' -a 'horizontal vertical'
complete -c riverctl -n '__fish_seen_subcommand_from map' -o 'release' -o 'repeat' -o 'layout'
complete -c riverctl -n '__fish_seen_subcommand_from unmap' -n '__fish_riverctl_complete_arg 2' -o 'release'
complete -c riverctl -n '__fish_seen_subcommand_from attach-mode' -n '__fish_riverctl_complete_arg 2' -a 'top bottom'
complete -c riverctl -n '__fish_seen_subcommand_from default-attach-mode' -n '__fish_riverctl_complete_arg 2' -a 'top bottom above below after'
complete -c riverctl -n '__fish_seen_subcommand_from output-attach-mode' -n '__fish_riverctl_complete_arg 2' -a 'top bottom above below after'
complete -c riverctl -n '__fish_seen_subcommand_from focus-follows-cursor' -n '__fish_riverctl_complete_arg 2' -a 'disabled normal always'
complete -c riverctl -n '__fish_seen_subcommand_from set-cursor-warp' -n '__fish_riverctl_complete_arg 2' -a 'disabled on-output-change on-focus-change'
complete -c riverctl -n '__fish_seen_subcommand_from list-rules' -n '__fish_riverctl_complete_arg 2' -a 'float ssd tag output position dimensions fullscreen'
complete -c riverctl -n '__fish_seen_subcommand_from list-rules' -n '__fish_riverctl_complete_arg 2' -a 'float ssd tags output position dimensions fullscreen'
# Options and subcommands for 'rule-add' and 'rule-del'
set -l rule_actions float no-float ssd csd tag output position dimensions fullscreen no-fullscreen
set -l rule_actions float no-float ssd csd tags output position dimensions fullscreen no-fullscreen
complete -c riverctl -n '__fish_seen_subcommand_from rule-add rule-del' -n "not __fish_seen_subcommand_from $rule_actions" -n 'not __fish_seen_argument -o app-id' -o 'app-id' -r
complete -c riverctl -n '__fish_seen_subcommand_from rule-add rule-del' -n "not __fish_seen_subcommand_from $rule_actions" -n 'not __fish_seen_argument -o title' -o 'title' -r
complete -c riverctl -n '__fish_seen_subcommand_from rule-add rule-del' -n "not __fish_seen_subcommand_from $rule_actions" -n 'test (math (count (commandline -opc)) % 2) -eq 0' -a "$rule_actions"