[xmonad] need help with Tabbed

Konstantin Sobolev konstantin.sobolev at gmail.com
Thu Apr 9 20:19:01 EDT 2009


On Thu, Apr 9, 2009 at 2:13 AM, Adam Vogt <vogt.adam at gmail.com> wrote:
> I find it interesting to compare solutions to problems I've looked at.
> Hopefully my suggestions are somewhat useful.

Of course!

> I think that this can be simplified by using more functions from
> XMonad.StackSet, and keeping the Maybe (W.Stack a) as it is from the
> pureModifier.
>
>> W.focusWindow (W.focus $ W.focusUp' ws)
>
> rather than:
>
>> W.modify' (cycl W.focusUp' ws)
>
> Since the cycl function could be a point of failure since it isn't as well
> tested as those in XMonad.StackSet, and also because I don't understand it
> :)

My intention was to allow cycling focus with wrapping around the
'corners' - something that can't
be achieved by mere focusWindow I think.
cycl keeps applying specified function (focusUp' or
focusDown' in my case) until focused window shows up among the windows
managed by
sublayout.

> If you allow the message contain a function, I think that it could simplify
> things and allow more options without having to touch the CycleFocus
> instance.

Yeah.. this idea gives so much power that it's almost an overkill for
my simple needs :)
It also looks like reimplementing some parts of SubLayouts.

>> data OnWindowSubset a = OnWindowSubset (W.Stack a -> W.Stack a)
>>  deriving (Read, Show, Typeable)
>> instance Typeable a => Message (OnWindowSubset a)

I've implemented this thing out of curiosity, it even works:

>       ,((myMod, xK_Right), sendMessage $ ModifyWindowSubset (W.focusDown'::(Stack Window -> Stack Window)))
>       ,((myMod, xK_Left), sendMessage $ ModifyWindowSubset (W.focusUp'::(Stack Window -> Stack Window)))

(BTW: I don't know how to get rid of this type annotation both here
and in the handleMess, see the source. GHC says
Ambiguous type variable `t' in the constraint: `Typeable t'
if I remove it. May be the message should be defined like
> data ModifyWindowSubset = ModifyWindowSubset (W.Stack Window -> W.Stack Window)
from the start? )

What confuses me is if it's really allowed to do arbitrary stack
modifications from handleMess: function that we pass
in the message can not only change focus, but it can rearrange the
windows, or even remove them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OnWindowSubset.hs
Type: text/x-haskell
Size: 3493 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/xmonad/attachments/20090409/3d23b72e/OnWindowSubset.bin


More information about the xmonad mailing list