about summary refs log tree commit diff
path: root/Completion/X
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2013-01-05 20:46:45 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2013-01-05 20:46:45 +0000
commita67802ba824ca3a7d27cbb54a5d3bcd13c14677a (patch)
tree3908399c02796fcca927c62cea4049fd6399be81 /Completion/X
parentedab1d3dbe61da7efe5f1ac0e40444b2ec9b9570 (diff)
downloadzsh-a67802ba824ca3a7d27cbb54a5d3bcd13c14677a.tar.gz
zsh-a67802ba824ca3a7d27cbb54a5d3bcd13c14677a.tar.xz
zsh-a67802ba824ca3a7d27cbb54a5d3bcd13c14677a.zip
30946: Robert Kovacsics: use xrandr command to generate completions
Diffstat (limited to 'Completion/X')
-rw-r--r--Completion/X/Command/_xrandr4
1 files changed, 2 insertions, 2 deletions
diff --git a/Completion/X/Command/_xrandr b/Completion/X/Command/_xrandr
index 2e51d0d23..9058610b2 100644
--- a/Completion/X/Command/_xrandr
+++ b/Completion/X/Command/_xrandr
@@ -4,8 +4,8 @@ typeset -A opt_args
 local outputs modes expl
 
 # User configurable. TODO -- styles?
-outputs=(LVDS1 TV1 VGA1)
-modes=(1280x800 1024x768 800x600 640x480)
+outputs=($(xrandr|sed -ne 's/^\([^[[:space:]]\+]*\) connected .*$/\1/p'))
+modes=($(xrandr|sed -ne 's/^[[:space:]]\+\([[:digit:]]\+x[[:digit:]]\+\).*$/\1/p'|sort -nr|uniq))
 
 _arguments \
   '(-d -display)'{-d,-display}':X display:_x_display' \