summary refs log tree commit diff
path: root/Completion/X/Command/_xrandr
diff options
context:
space:
mode:
authorGautam <gi1242+zsh@gmail.com>2017-10-15 14:59:32 -0400
committerPeter Stephenson <pws@zsh.org>2017-10-16 09:46:14 +0100
commit82b275d53ad0f367f78cbd41b68b26ca9c08ca8d (patch)
treedd6dd8286fa9a4f5d70b4e46960b83bcabe00d6a /Completion/X/Command/_xrandr
parent96845524a66aecfd4fa01f1b23f80bbf753f1130 (diff)
downloadzsh-82b275d53ad0f367f78cbd41b68b26ca9c08ca8d.tar.gz
zsh-82b275d53ad0f367f78cbd41b68b26ca9c08ca8d.tar.xz
zsh-82b275d53ad0f367f78cbd41b68b26ca9c08ca8d.zip
41904: new deborphan and updated xrandr completions
Diffstat (limited to 'Completion/X/Command/_xrandr')
-rw-r--r--Completion/X/Command/_xrandr7
1 files changed, 5 insertions, 2 deletions
diff --git a/Completion/X/Command/_xrandr b/Completion/X/Command/_xrandr
index b0851569e..26d8cd082 100644
--- a/Completion/X/Command/_xrandr
+++ b/Completion/X/Command/_xrandr
@@ -58,8 +58,11 @@ case $state in
     esac
   ;;
   outputs)
-    _wanted outputs expl output compadd \
-        ${(uo)${(M)${(f)"$(_call_program outputs xrandr)"}:#* connected*}%% *} && return 0
+    local -a xrandr_output=(${(f)"$(_call_program outputs xrandr)"})
+    _alternative \
+	'connected:connected outputs:('${(j: :)${(uo)${(M)xrandr_output:#* connected*}%% *}}')' \
+	'disconnected:disconnected outputs:('${(j: :)${(uo)${(M)xrandr_output:#* disconnected*}%% *}}')' \
+	&& return 0
   ;;
   modes)
     _wanted modes expl mode compadd \