[dev] program descriptions with dmenu_run(1); or, whatis(1) in place of dmenu_path?

0 views
Skip to first unread message

Sebastien Peterson-Boudreau

unread,
Apr 23, 2026, 6:46:15 PM (10 days ago) Apr 23
to d...@suckless.org
I was tinkering around with trying to get dmenu to
show the one-line man(1) descriptions of programs.
Originally, I actually got this idea playing around
with pick(1)[1], because its -d option would allow
it to select the program name without the
description, so long as you separated them with a
tab and set IFS accordingly, but I did realize
promptly while trying to do this that I could
simply parse the output of dmenu with cut(1) to get
the first word, and arrived upon this pipeline:

$ whatis -ws1 '*' | dmenu | cut -d' ' -f1

(it's usually better to use the -l option with
dmenu so you can actually _read_ these descriptions)

This runs about equally as fast as listing solely
the program names via dmenu_path, and I don't have
any pages in section 1 without a corresponding
program, so there aren't any issues. The output can
be a bit messy because I have both 1 and 1p
versions of some pages, though, but it's much
faster than any attempts to combine the output of
dmenu_path with whatis using xargs etc.

I'm going to continue using dmenu_run with
dmenu_path because I know what all the programs on
my system do (especially if I'm launching them with
dmenu_run), but I wanted to share this because I
thought it was neat :) if anyone had any other
solutions/criticisms, let me know!
---
[1] - https://github.com/mptre/pick
--
S.

Reply all
Reply to author
Forward
0 new messages