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

Tue Jan 15 05:51:39 CET 2008 Andrea Rossato

On Thu, Jan 24, 2008 at 06:20:06PM +0100, Andrea Rossato wrote:
Thu Jan 24 18:00:00 CET 2008 Andrea Rossato
* WindowArranger is now a pure layout modifier Thu Jan 24 18:16:49 CET 2008 Andrea Rossato
* 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 }

On Thu, Jan 24, 2008 at 06:47:10PM +0100, Andrea Rossato wrote:
Thu Jan 24 18:16:49 CET 2008 Andrea Rossato
* Add Decoration, a layout modifier and a class for easily adding decorations to layouts 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
the first issue... the 'decorate' method of the DecorationStyle class was not in the X monad (I try to write pure code only, lately...;) So I changed that: now it is returning a X (Maybe Rectangle). But I added a pureDecoration method too. This way we can define Tabbed, DwmLike and Simple with pure functions.... cool isn't it? Cheers, Andrea

Hi Andrea,
I can't wait to try it when it's complete!
Window titles have been my top wish list item since the beginning!
Thanks for working on this!
ciao,
Nick
On Jan 24, 2008 6:47 PM, Andrea Rossato
On Thu, Jan 24, 2008 at 06:20:06PM +0100, Andrea Rossato wrote:
Thu Jan 24 18:00:00 CET 2008 Andrea Rossato
* WindowArranger is now a pure layout modifier Thu Jan 24 18:16:49 CET 2008 Andrea Rossato
* 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 } _______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
-- The universe is a giant Rorschach ink-blot - Alan Watts

On Fri, Jan 25, 2008 at 04:36:20PM +0100, Nicola Paolucci wrote:
Hi Andrea,
I can't wait to try it when it's complete! Window titles have been my top wish list item since the beginning! Thanks for working on this!
ciao, Nick
Hi Nick, I've just send a message where you can find everything. The completed stuff, I mean. A mouse interface is missing, but you'll have to wait *after* 0.6 for that. It should be very simple now to write a decorated layout. Hope you'll enjoy. ciao andrea

please forget the patches below. I'm resending. a On Thu, Jan 24, 2008 at 06:20:06PM +0100, Andrea Rossato wrote:
Tue Jan 15 05:51:39 CET 2008 Andrea Rossato
* Layout.ShowWName: generalize the instance Fri Jan 18 20:01:45 CET 2008 Andrea Rossato
* Add WindowArranger a layout modifier to move and resize windows in any layout Sat Jan 19 14:44:36 CET 2008 Andrea Rossato
* WindowArranger: some bug fixes and more code cleanup Tue Jan 22 12:11:35 CET 2008 Andrea Rossato
* Add Layout.ResizeScreen, a layout transformer to have a layout respect a given screen geometry Tue Jan 22 12:13:19 CET 2008 Andrea Rossato
* LayoutModifier: add pureMess and pureModifier to the LayoutModifier class Thu Jan 24 02:56:05 CET 2008 Andrea Rossato
* LayoutModifier: add emptyLayoutMod for dealing with empty workspaces Thu Jan 24 14:46:38 CET 2008 Andrea Rossato
* XUtils: add functions for operating on lists of windows and export fi Thu Jan 24 14:47:25 CET 2008 Andrea Rossato
* ShowWName: moved fi to XUtils Thu Jan 24 17:51:12 CET 2008 Andrea Rossato
* ResizeScreen: add an empy description Thu Jan 24 18:00:00 CET 2008 Andrea Rossato
* WindowArranger is now a pure layout modifier Thu Jan 24 18:16:49 CET 2008 Andrea Rossato
* Add Decoration, a layout modifier and a class for easily adding decorations to layouts
participants (2)
-
Andrea Rossato
-
Nicola Paolucci