Re: [dev] wmii - key events are not read unless they are repeated

From: Suraj N. Kurapati <sunaku_AT_gmail.com>
Date: Sat, 7 May 2011 23:14:26 -0700

On Sun 08 May 2011 03:54:33 PM PDT, Ben Smith wrote:
> the programs list does not appear until its pressed a few times,
> or another action if called.

That's because your program list is being re-computed every time you
press Mod4-p. To fix this, compute the program list once and cache
it in memory (or on disk) and then re-use it in your Mod4-p handler.

Something like the following (untested):

> proglist() {
> IFS=: set -- $1
> find -L $@ -maxdepth 1 -perm /111 | sed '1d; s,.*/,,' | sort |
> uniq unset IFS
> }

proglist_cache=$(proglist $PATH)

>
> # Run program
> Mod4-p)
> eval exec wmiir setsid "$(proglist $PATH | wimenu -s 0)" &
> ;;

Mod4-p)
    eval exec wmiir setsid "$(echo proglist_cache | wimenu -s 0)" &

--
Beware of Programmers who carry screwdrivers.
		-- Leonard Brandwein
Received on Sun May 08 2011 - 08:14:26 CEST

This archive was generated by hypermail 2.2.0 : Sun May 08 2011 - 08:24:03 CEST