stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] simple tiling


From: Friedrich Delgado Friedrichs
Subject: Re: [STUMP] simple tiling
Date: Sun, 13 Dec 2009 22:48:41 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hi!

I think I may remember you from my sawfish days, but I'm not
completely sure ;)

I know it's been a long time since you wrote this, and I've been
meaning to look at it for quite some time.

You may have moved on to a more friendly window manager by now, but I'd
still like to comment on this.

Jose A. Ortega Ruiz schrieb:
> 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).

Yeah, some of those hooks are never called. There's one called
*destroy-window-hook*, though, that works in the same group if a
window gets destroyed. Someone should fix the code so that
*unmap-window-hook* is called in the right moment. I guess it's never
been done because there wasn't an obvious use case.

> 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.
---Zitatende---

I totally can't comment on unstumpy or even uncommon-lispy, I'm more
fluent with scheme and I always have to read the hyperspec on half the
functions I have to use whenever I try something new in my stumpwm
config ;)

Fortunately the stumpwm source code is (still!) rather small and I
think it's pretty readable (for a window manager).

Unfortunately I need something a bit more complicated, but I'm too
lazy to implement it. I just have a half-cooked requirements list
lying around that talks about fixed frames and their geometry, and
window size hints, and main tiling frames and constraint based
algorithms to allocate the rest of the screen estate. Probably too
complicated anyways ;)

So I'll probably stick with my (fixed) screen layout at least the next
few months.

Kind regards
     Friedel
-- 
        Friedrich Delgado Friedrichs <address@hidden>
                             TauPan on Ircnet and Freenode ;)

Attachment: pgpI5KPI5m0cL.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]