Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Changes to xrandr completion
- X-seq: zsh-workers 30947
- From: Christian Neukirchen <chneukirchen@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Changes to xrandr completion
- Date: Sat, 05 Jan 2013 21:15:35 +0100
- In-reply-to: <20130105191445.6e9bff3d@KR2-ARCH> (Kovacsics Robert's message of "Sat, 5 Jan 2013 19:14:45 +0000")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20130105191445.6e9bff3d@KR2-ARCH>
- Sender: chris@juno
Kovacsics Robert <kovirobi@xxxxxxxxx> writes:
> Hi!
> I would like to add the changes in the patch file for a smarter xrandr
> completion.
> Thank you,
> Robert Kovacsics
>
> --- a/zsh-5.0.2/Completion/X/Command/_xrandr 2011-01-08 20:24:47.000000000 +0000
> +++ b/zsh-5.0.2/Completion/X/Command/_xrandr 2013-01-05 19:09:53.564221743 +0000
> @@ -4,8 +4,8 @@
> 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' \
Hah, I wanted to do something similar. I'd propose to make it a
"zstyle -e" by default.
Also, you can use
${(uo)${(M)${(f)"$(xrandr)"}:#* connected*}%% *}
and
${(Mun)$(xrandr):#[0-9]##x[0-9]##}
--
Christian Neukirchen <chneukirchen@xxxxxxxxx> http://chneukirchen.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author