Discussion:
[xmonad] Mirrored keybindings with mirrored layout
Andreas Doll
2016-04-11 14:20:16 UTC
Permalink
Hello

I use the ResizableTall layout and configured key bindings for resizing
windows which resemble vim movements:

("M-S-j", sendMessage MirrorShrink)
("M-S-k", sendMessage MirrorExpand)
("M-S-h", sendMessage Shrink)
("M-S-l", sendMessage Expand)

Now when I use a mirrored variant of this layout, the key bindings are
mirrored as well - meaning that j/k change the window size horizontally and
h/k vertically.

Is it possible to keep the original behaviour also in the mirrored layout variant?

Best regards,
Andreas
adam vogt
2016-04-11 18:26:40 UTC
Permalink
Hi Andreas,

You could check the layout description of the current layout for "Mirror"
(or something else if you're using XMonad.Layout.Named), and then have the
key binding send the message that makes more sense for the given layout.

This is probably a good start that compiles but I didn't test it <
http://lpaste.net/8970541507006169088>.

Cheers,
Adam
Post by Andreas Doll
Hello
I use the ResizableTall layout and configured key bindings for resizing
("M-S-j", sendMessage MirrorShrink)
("M-S-k", sendMessage MirrorExpand)
("M-S-h", sendMessage Shrink)
("M-S-l", sendMessage Expand)
Now when I use a mirrored variant of this layout, the key bindings are
mirrored as well - meaning that j/k change the window size horizontally and
h/k vertically.
Is it possible to keep the original behaviour also in the mirrored layout variant?
Best regards,
Andreas
_______________________________________________
xmonad mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
Andreas Doll
2016-04-11 22:21:01 UTC
Permalink
You could check the layout description of the current layout for "Mirror" (or
something else if you're using XMonad.Layout.Named), and then have the key
binding send the message that makes more sense for the given layout.
This is probably a good start that compiles but I didn't test it <http://
lpaste.net/8970541507006169088>.
Thanks! In flipD I have to use U -> L, D -> R, besides that it works like a
charm.

Best regards,
Andreas

Loading...