diff options
Diffstat (limited to 'completions/xrandr')
-rw-r--r-- | completions/xrandr | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/completions/xrandr b/completions/xrandr index 841904a5..9b5b6a59 100644 --- a/completions/xrandr +++ b/completions/xrandr @@ -12,8 +12,8 @@ _xrandr() return ;; --output|--left-of|--right-of|--above|--below|--same-as) - local outputs=$( "$1" | awk '/connected/ {print $1}' ) - COMPREPLY=( $( compgen -W "$outputs" -- "$cur" ) ) + local outputs=$("$1" | awk '/connected/ {print $1}') + COMPREPLY=( $(compgen -W "$outputs" -- "$cur") ) return ;; --mode) @@ -25,37 +25,38 @@ _xrandr() fi done if [[ $output ]]; then - local modes=$( "$1" | command 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" ) ) + -e "s/\([^[:space:]]\)[[:space:]].*/\1/") + COMPREPLY=( $(compgen -W "$modes" -- "$cur") ) fi return ;; -o|--orientation) - COMPREPLY=( $( compgen -W 'normal inverted left right 0 1 2 3' -- \ - "$cur" ) ) + COMPREPLY=( $(compgen -W 'normal inverted left right 0 1 2 3' -- \ + "$cur") ) return ;; --reflect) - COMPREPLY=( $( compgen -W 'normal x y xy' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'normal x y xy' -- "$cur") ) return ;; --rotate) - COMPREPLY=( $( compgen -W 'normal inverted left right' -- "$cur" ) ) + 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" ) ) + 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 | - command sed -e "s/ or / /g" -e "s/<[^>]*>]//g" | _parse_help - )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" -help 2>&1 | + command sed -e "s/ or / /g" -e "s/<[^>]*>]//g" | _parse_help -)' \ + -- "$cur") ) } && complete -F _xrandr xrandr |