xrandr: Use the invoked command internally, not hardcoded "xrandr"

This commit is contained in:
Ville Skyttä 2014-04-03 10:43:18 +03:00
parent c50313c30d
commit b758afc105

View File

@ -12,7 +12,7 @@ _xrandr()
return return
;; ;;
--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=$( "$1" | awk '/connected/ {print $1}' )
COMPREPLY=( $( compgen -W "$outputs" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$outputs" -- "$cur" ) )
return return
;; ;;
@ -25,7 +25,7 @@ _xrandr()
fi fi
done done
if [[ $output ]]; then if [[ $output ]]; then
local modes=$( xrandr | sed -e "1,/$output/ d" \ local modes=$( "$1" | sed -e "1,/$output/ d" \
-e "/connected/,$ d" \ -e "/connected/,$ d" \
-e "s/\([^[:space:]]\)[[:space:]].*/\1/" ) -e "s/\([^[:space:]]\)[[:space:]].*/\1/" )
COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) )