summaryrefslogtreecommitdiff
path: root/completions/xrandr
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.eti.br>2017-09-25 23:46:54 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.eti.br>2017-09-25 23:46:54 -0300
commit6d88f1055806932d9291f96847d2b691cccda2cd (patch)
tree0ff79eedaa8a239331256048981deedbd0721965 /completions/xrandr
parent059a87a5936cfebfd2d71ab8057002cafb2ea051 (diff)
downloadbash-completion-6d88f1055806932d9291f96847d2b691cccda2cd.tar.gz
New upstream version 2.7upstream/2.7
Diffstat (limited to 'completions/xrandr')
-rw-r--r--completions/xrandr15
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