xrandr: Cleanups.
This commit is contained in:
parent
d66fc76be6
commit
a3d4266cab
@ -5,8 +5,6 @@ _xrandr()
|
|||||||
local cur prev words cword
|
local cur prev words cword
|
||||||
_init_completion || return
|
_init_completion || return
|
||||||
|
|
||||||
local output modes
|
|
||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
--output|--left-of|--right-of|--above|--below|--same-as)
|
--output|--left-of|--right-of|--above|--below|--same-as)
|
||||||
local outputs=$( xrandr | awk '/connected/ {print $1}' )
|
local outputs=$( xrandr | awk '/connected/ {print $1}' )
|
||||||
@ -14,14 +12,14 @@ _xrandr()
|
|||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
--mode)
|
--mode)
|
||||||
local i
|
local i output
|
||||||
for(( i = 1; i < cword; i++ )); do
|
for (( i=1; i < cword; i++ )); do
|
||||||
if [[ "${words[i]}" == --output ]]; then
|
if [[ "${words[i]}" == --output ]]; then
|
||||||
output=${words[i+1]}
|
output=${words[i+1]}
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
modes=$( xrandr | sed -e "1,/$output/ d" \
|
local modes=$( xrandr | sed -e "1,/$output/ d" \
|
||||||
-e "/connected/,$ d" | awk '{print $1}' )
|
-e "/connected/,$ d" | awk '{print $1}' )
|
||||||
COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) )
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user