Re: [dwm] dmenu request

From: Alexander Polakov <polachok_AT_gmail.com>
Date: Thu, 30 Nov 2006 23:50:30 +0300

* Bill Puschmann <puschy_AT_gmail.com> [061130 23:35]:
> I'm curious if it would even be possible to allow typing into dmenu before
> the "tab-completion" fields being piped in are populated.
>
> The current setup/expected configuration is to compile and sort a list of
> executables - which is great when I'm not in the middle of something
> processor intensive. At these times, hitting the dwm shortcut for dmenu
> takes forever. One of the things I liked about the WMII implementation was
> that it allowed to you start typing anyway, before the list was created.
>
> So in a situation where I want to bring up "rox", I could drop to the bar,
> type 'rox', hit return and be done with it. But now I have to hit 'dmenu'
> wait upwards of 30-50 seconds, type 'rox' and then it would appear. It's
> actually faster to open up a new terminal, type 'rox &; exit'.
>
> Perhaps some sort of shell magic to get all pipes correct? I'm just not
> sure.
>
> Bill
>
> --
>
> Pancho needs your prayers, it's true. But save a few for Lefty, too.
> -- T. Van Zandt
What about pregenerated list ?
from crontab
*/5 * * * * /home/polachok/bin/wmenu-gen

[polachok_AT_darkstar ~]# cat ~/bin/wmenu-gen
#!/bin/sh
eval `grep "export PATH" ~/.zshrc`
if [ -f /tmp/.wmiimenu.proglist ]
then
    touch /tmp/.wmiimenu.proglist
fi
proglist() {
        ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print
        $NF}' | sort -u
            }
export PROGS_FILE=/tmp/.wmiimenu.proglist || exit 2
proglist `echo "$PATH" | tr : ' '` >$PROGS_FILE

Add wmenu to shortcut in config.h
[polachok_AT_darkstar ~]# cat ~/bin/wmenu
#!/bin/sh
export PROGS_FILE=/tmp/.wmiimenu.proglist || exit 2
NORMBGCOLOR="#303030"
NORMFGCOLOR="#dc7a00"
SELFGCOLOR="#FFB800"
SELBGCOLOR="#303030"
dmenu -normbg "$NORMBGCOLOR" -normfg "$NORMFGCOLOR" -selbg "$SELBGCOLOR" -selfg "$SELFGCOLOR" <$PROGS_FILE`

When installing new software just run wmenu-gen

-- 
Alexander Polakov | http://polachok.livejournal.com
Received on Thu Nov 30 2006 - 21:51:17 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:33:04 UTC