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 }