diff options
author | Anders Engstrom <ankaan@gmail.com> | 2009-05-03 12:59:50 +0200 |
---|---|---|
committer | Anders Engstrom <ankaan@gmail.com> | 2009-05-03 12:59:50 +0200 |
commit | a9fa10d52bde5d56d240dae3fb6687f1baa74eb0 (patch) | |
tree | 84bf4dccd6d55ae3f912dcb702b85c2116d4e7ac /XMonad/Layout | |
parent | 9aad112502bbf81ef02e361f77b0d73c374e37e4 (diff) | |
download | XMonadContrib-a9fa10d52bde5d56d240dae3fb6687f1baa74eb0.tar.gz XMonadContrib-a9fa10d52bde5d56d240dae3fb6687f1baa74eb0.tar.xz XMonadContrib-a9fa10d52bde5d56d240dae3fb6687f1baa74eb0.zip |
nameTail - Remove the first word of a layout description
Ignore-this: a44c5e38163ed98ffc244cdd206632d1
darcs-hash:20090503105950-8978f-1fbd2470928f67b7ce979e4d2df7102798ab215e.gz
Diffstat (limited to 'XMonad/Layout')
-rw-r--r-- | XMonad/Layout/Named.hs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/XMonad/Layout/Named.hs b/XMonad/Layout/Named.hs index 8cace81..f742acb 100644 --- a/XMonad/Layout/Named.hs +++ b/XMonad/Layout/Named.hs @@ -17,9 +17,11 @@ module XMonad.Layout.Named ( -- * Usage -- $usage - named + named, + nameTail ) where +import XMonad import XMonad.Layout.LayoutModifier -- $usage @@ -30,13 +32,14 @@ import XMonad.Layout.LayoutModifier -- Then edit your @layoutHook@ by adding the Named layout modifier -- to some layout: -- --- > myLayouts = named "real big" Full ||| etc.. +-- > myLayouts = named "real big" Full ||| (nameTail $ named "real big" $ Full) ||| etc.. -- > main = xmonad defaultConfig { layoutHook = myLayouts } -- -- For more detailed instructions on editing the layoutHook see: -- -- "XMonad.Doc.Extending#Editing_the_layout_hook" +-- | Rename a layout. named :: String -> l a -> ModifiedLayout Named l a named s = ModifiedLayout (Named s) @@ -44,3 +47,13 @@ data Named a = Named String deriving ( Read, Show ) instance LayoutModifier Named a where modifyDescription (Named n) _ = n + + +-- | Remove the first word of the name. +nameTail :: l a -> ModifiedLayout NameTail l a +nameTail = ModifiedLayout NameTail + +data NameTail a = NameTail deriving (Read,Show) + +instance LayoutModifier NameTail a where + modifyDescription NameTail i = dropWhile (==' ') $ dropWhile (/=' ') $ description i |