From a67802ba824ca3a7d27cbb54a5d3bcd13c14677a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 5 Jan 2013 20:46:45 +0000 Subject: 30946: Robert Kovacsics: use xrandr command to generate completions --- Completion/X/Command/_xrandr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Completion/X/Command') 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' \ -- cgit 1.4.1