1 # autorandr/auto-disper completion by Maciej 'macieks' Sitarz <macieks@freesco.pl>
5 local cur prev opts lopts prfls
8 cur="${COMP_WORDS[COMP_CWORD]}"
9 prev="${COMP_WORDS[COMP_CWORD-1]}"
12 lopts="--help --change --save --load --default --force --fingerprint --config"
13 if [ -d ~/.autorandr ]; then
14 prfls="`find ~/.autorandr/* -maxdepth 1 -type d -printf '%f\n'`"
21 COMPREPLY=( $( compgen -W "${lopts}" -- $cur ) )
25 COMPREPLY=( $( compgen -W "${opts} ${lopts}" -- $cur ) )
29 if [ $COMP_CWORD -eq 1 ]; then
30 COMPREPLY=( $( compgen -W "${opts} ${lopts}" -- $cur ) )
36 -l|--load|-d|--default)
37 COMPREPLY=( $( compgen -W "${prfls}" -- $cur ) )
46 complete -F _autorandr autorandr
47 complete -F _autorandr auto-disper