summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2013-02-02 19:40:46 +0200
committerVille Skyttä <ville.skytta@iki.fi>2013-02-02 19:40:46 +0200
commita3d4266cab93e2dacf4fc058344f10a0e0860313 (patch)
treea1f415e7c6b4bbb90550a55ee78a5c1e31eaf22e
parentd66fc76be6058098d98e07e049db92079268dc0f (diff)
downloadbash-completion-a3d4266cab93e2dacf4fc058344f10a0e0860313.tar.gz
xrandr: Cleanups.
-rw-r--r--completions/xrandr8
1 files changed, 3 insertions, 5 deletions
diff --git a/completions/xrandr b/completions/xrandr
index 3b89f0c1..757b6589 100644
--- a/completions/xrandr
+++ b/completions/xrandr
@@ -5,8 +5,6 @@ _xrandr()
local cur prev words cword
_init_completion || return
- local output modes
-
case "$prev" in
--output|--left-of|--right-of|--above|--below|--same-as)
local outputs=$( xrandr | awk '/connected/ {print $1}' )
@@ -14,14 +12,14 @@ _xrandr()
return
;;
--mode)
- local i
- for(( i = 1; i < cword; i++ )); do
+ local i output
+ for (( i=1; i < cword; i++ )); do
if [[ "${words[i]}" == --output ]]; then
output=${words[i+1]}
break
fi
done
- modes=$( xrandr | sed -e "1,/$output/ d" \
+ local modes=$( xrandr | sed -e "1,/$output/ d" \
-e "/connected/,$ d" | awk '{print $1}' )
COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) )
return