diff options
Diffstat (limited to 'contrib/xrandr')
-rw-r--r-- | contrib/xrandr | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/contrib/xrandr b/contrib/xrandr index cd5c05b8..70de80f7 100644 --- a/contrib/xrandr +++ b/contrib/xrandr @@ -5,12 +5,11 @@ _xrandr() { local cur prev output modes COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --output) - local outputs=$(xrandr|grep 'connected'|awk '{print $1}') + local outputs=$(xrandr|awk '/connected/ {print $1}') COMPREPLY=( $(compgen -W "$outputs" -- "$cur")) return 0 ;; @@ -28,17 +27,14 @@ _xrandr() ;; esac - case "$cur" in + case $cur in *) - COMPREPLY=( $(compgen -W '-d -display -help -o \ - --orientation -q --query -s --size\ - -r --rate -v --version -x -y --screen \ - --verbose --dryrun --prop --fb \ - --fbmm --dpi --output --auto --mode \ - --preferred --pos --reflect --rotate \ - --left-of --right-of --above --below \ - --same-as --set --off --crtc --newmode \ - --rmmode --addmode --delmode' -- "$cur")) + COMPREPLY=( $(compgen -W '-display -help --orientation --query \ + --size --rate --version -x -y --screen --verbose --dryrun \ + --prop --fb --fbmm --dpi --output --auto --mode --preferred \ + --pos --reflect --rotate --left-of --right-of --above --below \ + --same-as --set --off --crtc --newmode --rmmode --addmode \ + --delmode' -- "$cur") ) return 0 ;; esac |