[dev] [dmenu] multiple menu patch

From: Yuri Bochkarev <baltazar.bz_AT_gmail.com>
Date: Tue, 3 Jul 2012 11:21:39 +0400

Hello, guys!

I'd like to share my patch for dmenu which enables multiple menus
option.

WHAT IT DOES
Multiple menus allow you to see and choose many options
during one dmenu run. It looks like this:
http://s1.ipicture.ru/uploads/20120702/s6YyU3zR.png
After you press Enter all selected items will be printed to console.

MOTIVATION
I have a small wrapper for scrot on bash which asks some
questions before taking a screenshot. The questions such as: take a
screenshot of the region or the whole screen, which filename to use,
delay, save file after publishing or not and so on. Also, I cache
answers for these questions. However, sometimes I need to take a
screenshot with slightly different param and then I have to answer all
questions again even though I want to change only one. With this patch
I can 1) see all questions at once 2) quickly jump to questions I want
to change. I belive this patch is a generalisation and can be useful
in larget set of cases than original dmenu.

WHERE TO GET
You can get it from my repo:

hg clone https://bitbucket.org/balta2ar/dmenu-multiple-menu
cd dmenu-multiple-menu
hg checkout multiple-menu

or apply patch to master repo:

hg clone http://hg.suckless.org/dmenu
cd dmenu
wget -O dmenu-4.5-multiple-menu.diff http://ix.io/2Cy
hg patch dmenu-4.5-multiple-menu.diff

Build and run:

make
./dmenu -id " " < test.txt

ARGUMENTS
The patch adds -id <delims> argument which sets item
delimeters string. Menu delimiter character in this case is set to
newline (\n).

WARNING
This version is my first attempt to hack dmenu. For now it is
just a quick and very dirty hack. Some old functionality is missing:
* no prompt support
* no vertical menus support there might be visual
* glitches and sudden crashes

USER EXPERIENCE
So what do you think? Do you like the idea? Can this
be of any use to anybody? The code is very messy for now because I
want to test the idea first and if people like it, I plan to refactor it.

ALTERNATIVES
One of the points of suckless' philosophy is to keep
things clean and simple. Some might agrue that these complications are
not necessary and can be avoided. If so, what are the alternatives
which implement abovementioned functionality? Am I reinventing a
wheel?

Thank you!


Best regards, Yuri.
Received on Tue Jul 03 2012 - 09:21:39 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 03 2012 - 09:24:10 CEST