summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Completion/X/Command/_xrandr4
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c76c61c66..4ff889885 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-05  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 30946: Robert Kovacsics: Completion/X/Command/_xrandr: use
+	command to generate completions.
+
 2013-01-04  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 30941: Completion/bashcompinit: scalars giving status of bash
@@ -426,5 +431,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5781 $
+* $Revision: 1.5782 $
 *****************************************************
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' \