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

2015-11-30 Thread Silvan Jegen
Heyho! On Sat, Nov 28, 2015 at 11:25 PM, Hiltjo Posthuma wrote: > 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 genera

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

2015-11-30 Thread Hiltjo Posthuma
On Mon, Nov 30, 2015 at 3:28 PM, Silvan Jegen wrote: > Heyho! > > On Sat, Nov 28, 2015 at 11:25 PM, Hiltjo Posthuma > wrote: >> On Fri, Nov 27, 2015 at 7:38 PM, Silvan Jegen wrote: >> This can be implemented in a few lines of shell (wc, sort) and maybe awk. > > I *have* implemented the history p

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

2015-11-30 Thread Roberto E. Vargas Caballero
On Mon, Nov 30, 2015 at 06:51:02PM +0100, Hiltjo Posthuma wrote: > Something like (quick hack): > > cat historyfile | awk '//{x[$0]++; } END { for (k in x) { print x[k] " >" k; }}' | sort -k 1rn,2 | cut -f 2- | dmenu >> historyfile > Avoid the death cat!!!. Use something like: awk '{x[$0]++