Re: [hackers] [dmenu][RFC][PATCH 0/4] Using sort and simple C program to get dmenu history functionality

From: Hiltjo Posthuma <>
Date: Sat, 28 Nov 2015 23:25:10 +0100

On Fri, Nov 27, 2015 at 7:38 PM, Silvan Jegen <> wrote:
> Heyhey
> I kept thinking about a more general way to implement history
> functionality for dmenu and this is what I came up with.
> We use the sort command to generate an input list for dmenu sorted by
> count (first patch). dmenu itself is not modified and shows the available
> commands with the most often used ones first (due to the sorting done
> by sort). Before sending the dmenu output to a shell we use a simple
> C program that reads a command from stdin for which it increments the
> usage count in the history file before sending the command to the shell
> to execute (patch 4; rest of the patches are just glue code).

This can be implemented in a few lines of shell (wc, sort) and maybe awk.

> * It uses the -t and -k options of sort which are not available for
> all sort implementations (not in sbase for example). If there is an
> easy way to replicate this functionality without using these sort
> options I would like to hear about it.

Sbase sort supports -t and -k, if some part of it is broken: send a patch.
Received on Sat Nov 28 2015 - 23:25:10 CET

This archive was generated by hypermail 2.3.0 : Sat Nov 28 2015 - 23:36:12 CET