[xmonad] patch: Add search string to X.A.GridSelect grid
johnnyspoon at gmail.com
Thu Jan 24 04:47:08 CET 2013
On 1/16/13, adam vogt <vogt.adam at gmail.com> wrote:
> 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)
do cmds <- io getCommands
g <- gridselect defaultGSConfig $ zip cmds cmds
whenJust g spawn
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 15871 bytes
Desc: not available
More information about the xmonad