xrandr: Use the invoked command internally, not hardcoded "xrandr"
This commit is contained in:
parent
c50313c30d
commit
b758afc105
@ -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" ) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user