[xmonad] darcs patch: Layout.ShowWName: generalize the instance (and 10 more)

Andrea Rossato mailing_list at istitutocolli.org
Thu Jan 24 12:47:10 EST 2008


On Thu, Jan 24, 2008 at 06:20:06PM +0100, Andrea Rossato wrote:
> Thu Jan 24 18:00:00 CET 2008  Andrea Rossato <andrea.rossato at unibz.it>
>   * WindowArranger is now a pure layout modifier
> 
> Thu Jan 24 18:16:49 CET 2008  Andrea Rossato <andrea.rossato at unibz.it>
>   * Add Decoration, a layout modifier and a class for easily adding decorations to layouts


As I said I'm working on a new decoration framework, in order to make
it easy to add decorations to layouts.

Here you can find some screenshots:

http://gorgias.mine.nu/xmonadShots/deco_tallDecorated.png
http://gorgias.mine.nu/xmonadShots/deco_tallDecorated_moved.png
http://gorgias.mine.nu/xmonadShots/deco_tabbedCircle.png
http://gorgias.mine.nu/xmonadShots/deco_tabbedCircle_moved.png
http://gorgias.mine.nu/xmonadShots/deco_circleSimpleDecoration.png
http://gorgias.mine.nu/xmonadShots/deco_dwmLike.png

Below you'll find an example of configuration.

Right now the code is still under development, but I just wanted to
share the idea.

In the next days I'll clean it up, especially Decoration.hs, but if
you have any idea, bug reports or whatever please let me know.

This code requires the patch I sent tonight to add an emptyLayout
method to the LayoutClass.

Cheers,

Andrea


the config sample: The first is the old tabbed layout, the second is a
dwm-like decoration (I never used it so I just followed others'
suggestions) with the default layout hook. The third one a simple
decoration with Circle.


import XMonad
import XMonad.Layout.Circle
import XMonad.Layout.Decoration
import XMonad.Layout.ResizeScreen
import XMonad.Layout.WindowArranger

import qualified Data.Map as M

myKeys x = [  ((modMask x .|. controlMask              , xK_s    ), sendMessage Arrange            )
            , ((modMask x .|. controlMask .|. shiftMask, xK_s    ), sendMessage DeArrange          )
            , ((modMask x .|. controlMask .|. shiftMask, xK_Left ), sendMessage (DecreaseLeft   10))
            , ((modMask x .|. controlMask .|. shiftMask, xK_Right), sendMessage (DecreaseRight  10))
            , ((modMask x .|. controlMask .|. shiftMask, xK_Down ), sendMessage (DecreaseDown   10))
            , ((modMask x .|. controlMask .|. shiftMask, xK_Up   ), sendMessage (DecreaseUp     10))
            , ((modMask x .|. controlMask              , xK_Left ), sendMessage (IncreaseLeft   10))
            , ((modMask x .|. controlMask              , xK_Right), sendMessage (IncreaseRight  10))
            , ((modMask x .|. controlMask              , xK_Down ), sendMessage (IncreaseDown   10))
            , ((modMask x .|. controlMask              , xK_Up   ), sendMessage (IncreaseUp     10))
            , ((modMask x .|. shiftMask                , xK_Left ), sendMessage (MoveLeft       10))
            , ((modMask x .|. shiftMask                , xK_Right), sendMessage (MoveRight      10))
            , ((modMask x .|. shiftMask                , xK_Down ), sendMessage (MoveDown       10))
            , ((modMask x .|. shiftMask                , xK_Up   ), sendMessage (MoveUp         10))
           ]

newKeys x  = M.union (keys defaultConfig x) (M.fromList (myKeys x))

myLayoutHook = decoration shrinkText defTabbedConfig  (windowArranger $ resizeVertical 20 Simplest) |||
               decoration shrinkText myDwmLikeConf  (windowArranger $ layoutHook defaultConfig  ) |||
               decoration shrinkText mySimpleConf  (windowArranger Circle  )

mySimpleConf = mkDefaultDeConfig $ Simple False 150 20
myDwmLikeConf = mkDefaultDeConfig $ Dwm 200 20

main = xmonad defaultConfig {
         keys = newKeys , modMask = mod4Mask, defaultGaps = [(15,0,0,0)],
         focusFollowsMouse = False,
         layoutHook = myLayoutHook
       }


More information about the xmonad mailing list