[clfswm-devel] rearrange windows
Fernando Aguayo
beren.olvar at gmail.com
Thu Nov 4 12:43:58 UTC 2010
Hi,
Normally, when I'm using the tiled layouts I like to rearrange the
position of my windows. Since I couldn't find a way to do it I wrote
this function, which just switches the position of the current window with
the next one in the frame:
-----------------------------------------------------------------
(defun change-pos (side)
(when (xlib:window-p *current-child*)
(let* ((parent (find-parent-frame *current-child*))
(managed-children (frame-child parent))
(len (length managed-children))
(pos (child-position *current-child* managed-children))
(npos (mod (+ pos side) len)))
(rotatef (nth pos (frame-child (find-parent-frame *current-child*)))
(nth npos (frame-child (find-parent-frame *current-child*))))
)))
-----------------------------------------------------------------
(sorry for my lisp ;)
This almost works: every time I change the indexing I have to change
the layout for it to take effect. I tried to change the layout inside
the function but it just doesn't have the same effect.
I also loose the focus of the moved window. How can I retain it?
Is there a better way to do it?
Thank you!
Fernando
More information about the clfswm-devel
mailing list