[dev] Re: [wmii] wimenu custom completion

From: LuX <lux.onthenet_AT_free.fr>
Date: Fri, 13 Aug 2010 12:15:41 +0200

Hi!

On Thu, Aug 12, 2010 at 09:19:52PM -0400, Kris Maglione wrote:
> Yes... Unfortunately awk dies on SIGPIPE in that example, so it never
> runs the END block. This slight variation should work:
[..]
> Oh, but I notice that this doesn't work with gawk.

Indeed.

> You'll need to replace the // line with { print; fllush() }. I'm
> afraid that if you use mawk it's hopeless.

I'm using awk. Your first variant, modified as above, works perfectly.
Thank you so much for your very kind and detailed answer!

> As for modifying it, you'd probably be happier with python,
> perl, or ruby, but I make a point of only using POSIX utilities
> in examples. But if you're looking for a start, this is the above modified to
> (crudely) complete a command and then files in the current
> directory:

Which language is it, perl?

I completely support this point on POSIX utilities (although I only
very vaguely know what POSIX means). For end users like me it's easier
to learn the basics of any common language like perl than to master
shell programming with fancy pipes and redirections (this is
incredibly smart and subtle, in my opinion). This makes such example,
although very hard to understand, extraordinary valuable: I would be
completely unable to find them by myself.

By the way, how did you guess that 'complete a command and then files
in the current directory' is precisely the kind of utilities I was
looking for? Would that mean that other people, even in this list, are
considering this as a useful alternative to opening a terminal? (Or at
least a fancy alternative, let's be honest.) No, I can't believe it…
please look at this:

Ref: http://lists.suckless.org/wmii/0701/3091.html

On Wed, Jan 17, 2007 at 01:55:43PM +0100, Martin Stubenschrott wrote:
> User wants to open a file with it's associated handler.(with wmii
> shortcuts):

> Alt-p to show all programs
> run-ma<tab> -> run-mailcap

> now it would be nice to have a second completion mode where the user
> could at least complete filenames, or maybe arbitrarily things like in
> bash-completion.

On Wed, 17 Jan 2007 14:15:01 +0100, Anselm R. Garbe answered:
> This has been discussed long ago several times and the answer
> is simple: no.

On Wed, Jan 17, 2007 at 02:15:01PM +0100, Martin Stubenschrott insisted:
> What I wanted to suggest was adding completion for arguments. I meant,
> after pressing tab someone obviously wants to add arguments. And why not
> help the user also with argument completion.

On Wed, 17 Jan 2007 15:08:06 +0100, Anselm R. Garbe closed the debate:
> I think the right place to achieve what you want is the shell,
> which supports this task already. dmenu is designed to run
> simple commands only.

Well, this might be today the main difference between dmenu and
wimenu, except if A.R. Garbe has changed his mind in the mean time. As
we say in France: « il n'y a que les imbéciles qui ne changent pas
d'avis » (only idiots never change their mind).

Note: I can't help recalling this discussion, because it seems funny
to me. Nevertheless I'm pretty grateful to all the developers of
suckless.org, of course, and I hope this and the above french
humoristic proverb won't hurt any of them (but I'm confident enough on
this point).

Best regards,
LuX.
Received on Fri Aug 13 2010 - 12:15:41 CEST

This archive was generated by hypermail 2.2.0 : Fri Aug 13 2010 - 12:24:02 CEST