diff options
Diffstat (limited to 'completions/xrandr')
-rw-r--r-- | completions/xrandr | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/completions/xrandr b/completions/xrandr index cef0941e..841904a5 100644 --- a/completions/xrandr +++ b/completions/xrandr @@ -12,7 +12,7 @@ _xrandr() return ;; --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" ) ) return ;; @@ -25,7 +25,7 @@ _xrandr() fi done if [[ $output ]]; then - local modes=$( xrandr | sed -e "1,/$output/ d" \ + local modes=$( "$1" | command sed -e "1,/$output/ d" \ -e "/connected/,$ d" \ -e "s/\([^[:space:]]\)[[:space:]].*/\1/" ) COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) ) @@ -45,11 +45,18 @@ _xrandr() COMPREPLY=( $( compgen -W 'normal inverted left right' -- "$cur" ) ) return ;; + --setprovideroutputsource|--setprovideroffloadsink) + local providers=$( "$1" --listproviders 2>/dev/null | + command sed -ne 's/.* name:\([^ ]*\).*/\1/p' ) + COMPREPLY=( $( compgen -W "$providers" -- "$cur" ) ) + # TODO 2nd arg needed, is that a provider as well? + return + ;; esac COMPREPLY=( $( compgen -W '$( "$1" -help 2>&1 | - sed -e "s/ or / /g" -e "s/<[^>]*>]//g" | _parse_help - )' -- "$cur" ) ) + command sed -e "s/ or / /g" -e "s/<[^>]*>]//g" | _parse_help - )' -- "$cur" ) ) } && complete -F _xrandr xrandr -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh |