git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commitc3c0dceee5943f05a30cd7e05a0e04d5c5b80807
parent8c120c7cbb
authortiosgz <[email protected]>
date2023-10-22 10:48
completions/bash: complete input devices, fix typos

 completions/bash/riverctl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/completions/bash/riverctl b/completions/bash/riverctl
index d964e7b..4b19d4c 100644
--- a/completions/bash/riverctl
+++ b/completions/bash/riverctl
@@ -62,6 +62,7 @@ function __riverctl_completion ()
 		case "${COMP_WORDS[1]}" in
 			"focus-output"|"send-to-output") OPTS="next previous" ;;
 			"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" ;;
@@ -93,7 +94,7 @@ function __riverctl_completion ()
 				tap-button-map \
 				scroll-method \
 				scroll-button"
-			COMPREPLY=($(compgen -W "${OPTS}" -- "${COMP_WORDS[2]}"))
+			COMPREPLY=($(compgen -W "${OPTS}" -- "${COMP_WORDS[3]}"))
 		elif [ "${COMP_WORDS[1]}" == "hide-cursor" ]
 		then
 			case "${COMP_WORDS[2]}" in
@@ -115,6 +116,7 @@ function __riverctl_completion ()
 				"scroll-method") OPTS="none two-finger edge button" ;;
 				*) return ;;
 			esac
+			COMPREPLY=($(compgen -W "${OPTS}" -- "${COMP_WORDS[4]}"))
 		elif [ "${COMP_WORDS[1]:0:5}" == "rule-" ]
 		then
 			case "${COMP_WORDS[2]}" in