river: add outputs rule

This commit is contained in:
Doclic
2023-10-19 12:58:11 +02:00
parent 206bb2e713
commit bf4154007d
8 changed files with 78 additions and 24 deletions

View File

@ -1,6 +1,6 @@
function __riverctl_completion ()
{
local rule_actions="float no-float ssd csd tag"
local rule_actions="float no-float ssd csd tag output"
if [ "${COMP_CWORD}" -eq 1 ]
then
OPTS=" \
@ -65,7 +65,7 @@ function __riverctl_completion ()
"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" ;;
"list-rules") OPTS="float ssd tag output" ;;
"map") OPTS="-release -repeat -layout" ;;
"unmap") OPTS="-release" ;;
"attach-mode") OPTS="top bottom" ;;

View File

@ -83,9 +83,9 @@ complete -c riverctl -x -n '__fish_seen_subcommand_from unmap' -a
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 always'
complete -c riverctl -x -n '__fish_seen_subcommand_from set-cursor-warp' -a 'disabled on-output-change on-focus-change'
complete -c riverctl -x -n '__fish_seen_subcommand_from rule-add' -a 'float no-float ssd csd tag'
complete -c riverctl -x -n '__fish_seen_subcommand_from rule-del' -a 'float no-float ssd csd tag'
complete -c riverctl -x -n '__fish_seen_subcommand_from list-rules' -a 'float ssd tag'
complete -c riverctl -x -n '__fish_seen_subcommand_from rule-add' -a 'float no-float ssd csd tag output'
complete -c riverctl -x -n '__fish_seen_subcommand_from rule-del' -a 'float no-float ssd csd tag output'
complete -c riverctl -x -n '__fish_seen_subcommand_from list-rules' -a 'float ssd tag output'
# Subcommands for 'input'
complete -c riverctl -x -n '__fish_seen_subcommand_from input; and __fish_riverctl_complete_arg 2' -a "(__riverctl_list_input_devices)"

View File

@ -183,9 +183,9 @@ _riverctl()
# In case of a new rule added in river, we just need
# to add it to the third option between '()',
# i.e (float no-float <new-option>)
_arguments '1: :(-app-id -title)' '2: : ' ':: :(float no-float ssd csd tag)'
_arguments '1: :(-app-id -title)' '2: : ' ':: :(float no-float ssd csd tag output)'
;;
list-rules) _alternative 'arguments:args:(float ssd tag)' ;;
list-rules) _alternative 'arguments:args:(float ssd tag output)' ;;
*) return 0 ;;
esac
;;