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"
14 if [ -d ~/.autorandr/ ]; then
15 prfls="`find ~/.autorandr/* -maxdepth 1 -type d -printf '%f\n'`"
20 COMPREPLY=( $( compgen -W "${lopts}" -- $cur ) )
24 COMPREPLY=( $( compgen -W "${opts} ${lopts}" -- $cur ) )
28 if [ $COMP_CWORD -eq 1 ]; then
29 COMPREPLY=( $( compgen -W "${opts} ${lopts}" -- $cur ) )
35 -l|--load|-d|--default)
36 COMPREPLY=( $( compgen -W "${prfls}" ) )
45 complete -F _autorandr autorandr
46 complete -F _autorandr auto-disper