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

commit88be51e47a0de3941acc0e4d97d9cdcdd1960283
parentec52cdac2d
authorLeon Henrik Plickat <[email protected]>
date2021-06-13 09:20
add bash completion for input commands

 completions/bash/riverctl | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/completions/bash/riverctl b/completions/bash/riverctl
index e0000b7..83708c0 100644
--- a/completions/bash/riverctl
+++ b/completions/bash/riverctl
@@ -8,6 +8,9 @@ function __riverctl_completion ()
 			float-filter-add \
 			focus-output \
 			focus-view \
+			input \
+			list-inputs \
+			list-input-configs \
 			move \
 			resize \
 			snap \
@@ -40,7 +43,7 @@ function __riverctl_completion ()
 			focus-follow-cursor \
 			opacity \
 			set-repeat \
-			xcursor-theme
+			xcursor-theme"
 		COMPREPLY=($(compgen -W "${OPTS}" -- "${COMP_WORDS[1]}"))
 	elif [ "${COMP_CWORD}" -eq 2 ]
 	then
@@ -54,6 +57,40 @@ function __riverctl_completion ()
 			*) return ;;
 		esac
 		COMPREPLY=($(compgen -W "${OPTS}" -- "${COMP_WORDS[2]}"))
+	elif [ "${COMP_CWORD}" -eq 3 ]
+	then
+		if [ "${COMP_WORDS[1]}" == "input" ]
+		then
+			OPTS="events \
+				accel-profile \
+				pointer-accel \
+				click-method \
+				drag \
+				drag-lock \
+				disable-while-typing \
+				middle-emulation \
+				natural-scroll \
+				left-handed \
+				tap \
+				tap-button-map \
+				scroll-method \
+				scroll-button"
+			COMPREPLY=($(compgen -W "${OPTS}" -- "${COMP_WORDS[2]}"))
+		fi
+	elif [ "${COMP_CWORD}" -eq 4 ]
+	then
+		if [ "${COMP_WORDS[1]}" == "input" ]
+		then
+			case "${COMP_WORDS[3]}" in
+				"events") OPTS="enabled disabled disabled-on-external-mouse" ;;
+				"accel-profile") OPTS="none flat adaptive" ;;
+				"click-method") OPTS="none button-areas clickfinger" ;;
+				"drag"|"drag-lock"|"disable-while-typing"|"middle-emulation"|"left-handed"|"tap") OPTS="enabled disabled" ;;
+				"tap-button-map") OPTS="left-right-middle left-middle-right" ;;
+				"scroll-method") OPTS="none two-finger edge button" ;;
+				*) return ;;
+			esac
+		fi
 	else
 		return
 	fi