
On 1/16/13, adam vogt
The patch works well, but I think it would be better to have:
gs_searchConverter :: String -> Maybe a
rather than `Maybe (String -> a)'. This way you could express things like: don't show an option to create a workspace with name "", or don't show an option to create a workspace with a name identical to a workspace which already existed.
Further generalization like: `gs_searchConverter :: String -> [(String, a)]' or even `gs_searchConverter :: String -> X [(String, a)]' might be useful for getting completions from the shell. If that happens, XMonad.Actions.GridSelect will get closer to XMonad.Prompt in terms of features.
Attached is a more elaborate patch bundle than before. It fixes an existing FIXME along the way, and generalizes my original idea as suggested. It's less obvious what's going on now, but I hope the added documentation is sufficiently clear. As far as using GridSelect and Prompt for launching things, don't the following already perform essentially the same function? Or did you have something else in mind? import XMonad (io, spawn, whenJust) import XMonad.Actions.GridSelect (defaultGSConfig, gridselect) import XMonad.Prompt (defaultXPConfig) import XMonad.Prompt.Shell (getCommands, shellPrompt) -- (1) do cmds <- io getCommands g <- gridselect defaultGSConfig $ zip cmds cmds whenJust g spawn -- (2) shellPrompt defaultXPConfig