about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/X/Command/_xrandr10
1 files changed, 7 insertions, 3 deletions
diff --git a/Completion/X/Command/_xrandr b/Completion/X/Command/_xrandr
index 67045b33d..6143054aa 100644
--- a/Completion/X/Command/_xrandr
+++ b/Completion/X/Command/_xrandr
@@ -1,6 +1,6 @@
 #compdef xrandr
 
-local curcontext="$curcontext" state line expl
+local curcontext="$curcontext" state line expl state_descr
 typeset -A opt_args
 
 _arguments -C \
@@ -47,8 +47,8 @@ _arguments -C \
   "*--addmode:output:->outputs:name" \
   "*--delmode:output:->outputs:name" \
   '--listproviders' \
-  '--setprovideroutputsource:provider: :source' \
-  '--setprovideroffloadsink:provider: :sink' \
+  '--setprovideroutputsource:provider:->providers:source:->providers' \
+  '--setprovideroffloadsink:provider:->providers:sink:->providers' \
   '--listmonitors' \
   '--listactivemonitors' \
   '--setmonitor:name' \
@@ -75,4 +75,8 @@ case $state in
     _wanted modes expl mode compadd \
         ${(Mun)$(_call_program modes xrandr):#[0-9]##x[0-9]##} && return 0
   ;;
+  providers)
+    local -a xrandr_providers=(${(f)"$(_call_program providers xrandr --listproviders)"})
+    _wanted xrandr-providers expl $state_descr compadd ${${xrandr_providers}[2,-1]##*:} && return 0
+  ;;
 esac