From 9d661a14bacb88fa9bc6239bb83114198ef1e087 Mon Sep 17 00:00:00 2001 From: JezerM Date: Sun, 12 Sep 2021 19:47:50 -0600 Subject: [PATCH] Bash and Zsh completion updated --- dist/web-greeter-bash | 3 ++- dist/web-greeter-zsh | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dist/web-greeter-bash b/dist/web-greeter-bash index ab51e11..dcb7083 100644 --- a/dist/web-greeter-bash +++ b/dist/web-greeter-bash @@ -9,12 +9,13 @@ _web-greeter() { case "${last}" in --theme) + _filedir options=$(ls -1d /usr/share/web-greeter/themes/*/ | cut -c 1- | rev | cut -c 2- | rev | sort | sed 's/\/usr\/share\/web-greeter\/themes\///') ;; esac - COMPREPLY=( $(compgen -W "${options}" -- "${cur}") ) + COMPREPLY+=( $(compgen -W "${options}" -- "${cur}") ) } complete -F _web-greeter web-greeter diff --git a/dist/web-greeter-zsh b/dist/web-greeter-zsh index 3de4b0b..e9d81d9 100644 --- a/dist/web-greeter-zsh +++ b/dist/web-greeter-zsh @@ -9,13 +9,19 @@ _webgreeter() { '--debug[Runs the greeter in debug mode]' '--normal[Runs in non-debug mode]' '--list[Lists available themes]' - "--theme[Sets the theme to use]:theme:(${themes})" + "--theme[Sets the theme to use]:theme:->themes" '--help[Show help]' '-h[Show help]' '--version[Print program version]' '-v[Print program version]' ) _arguments $args[@] && ret=0 + case "$state" in + themes) + _files + _values 'themes' "${(uonzf)${themes}}" + ;; + esac return ret }