> > hi, > > i just switched to stumpwm from xmonad and wanted something similar to > the latter's Tall layout, i.e., a group where there's an horizontal > split with one window on the left and the rest vertically stacked in the > right (which is split vertically as many times as needed). for instance, > with 4 windows: > > ------------------------------- > | | | > | |---------------| > | | | > | |---------------| > | | | > ------------------------------- > > so i wrote this command: > > (defun jao-tile-group (group) > (let* ((tlen (length (group-windows group))) > (len (1- tlen))) > (unless (zerop tlen) > (call-interactively "only") > (unless (current-window) > (focus-next-window group))) > (unless (zerop len) > (split-frame group :column) > (focus-next-frame group) > (dotimes (n (1- len)) > (split-frame group :row (/ (- len n))) > (focus-next-frame group)) > (focus-next-frame group)))) > > (defcommand (tile tile-group) () () > (jao-tile-group (current-group))) > > and a bit of code to auto-tile registered groups everytime a new window > is added: > > (defvar *jao-autotiling-groups* '("doc")) > > (defun jao-autotile-hook (&optional window) > (when (member (group-name (current-group)) *jao-autotiling-groups* > :test #'equalp) > (jao-tile-group (current-group)))) > > (add-hook *new-window-hook* #'jao-autotile-hook) > (add-hook *unmap-window-hook* #'jao-autotile-hook) > > all of which works fine (except for the fact that the hooks in > *unmap-window-hook* are not being called, unless i'm missing something). > > this being my very first hack in stumpwm, i suspect it offers ample room > for improvement, and that's the main reason i'm posting it: i'd greatly > appreciate your comments on any of the silly or unstumpy things i'm > doing above. > > thanks! > jao > -- > A language that doesn't affect the way you think about programming, is > not worth knowing. > - Alan Perlis, Epigrams in Programing > > > > _______________________________________________ > Stumpwm-devel mailing list > Stumpwm-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/stumpwm-devel >
Thanks for this, the lack of auto tiling in stumpwm made me go back to Xmonad again, now I may switch back to stumpwm. _______________________________________________ Stumpwm-devel mailing list Stumpwm-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/stumpwm-devel