aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-09-25 22:53:33 +0200
committerDavid Roundy <droundy@darcs.net>2007-09-25 22:53:33 +0200
commitec697eed5aebecb065ff7f15345ad21965225e1e (patch)
tree5db7dc9aa22e4a45591a8bf3c24eb9397410f662
parente021d93178b52c3ec845bbaa6bb481a25468ebe1 (diff)
downloadXMonadContrib-ec697eed5aebecb065ff7f15345ad21965225e1e.tar.gz
XMonadContrib-ec697eed5aebecb065ff7f15345ad21965225e1e.tar.xz
XMonadContrib-ec697eed5aebecb065ff7f15345ad21965225e1e.zip
new SetLayout module.
darcs-hash:20070925205333-72aca-a0e22f8e9613bc9b340b606f3ba7d73f951e3edc.gz
Diffstat (limited to '')
-rw-r--r--SetLayout.hs40
1 files changed, 40 insertions, 0 deletions
diff --git a/SetLayout.hs b/SetLayout.hs
new file mode 100644
index 0000000..dabb0b5
--- /dev/null
+++ b/SetLayout.hs
@@ -0,0 +1,40 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module : XMonadContrib.SetLayout
+-- Copyright : (c) David Roundy <droundy@darcs.net>
+-- License : BSD3-style (see LICENSE)
+--
+-- Maintainer : David Roundy <droundy@darcs.net>
+-- Stability : unstable
+-- Portability : unportable
+--
+-- Provides bindings to cycle through non-empty workspaces.
+--
+-----------------------------------------------------------------------------
+
+module XMonadContrib.SetLayout (
+ -- * Usage
+ -- $usage
+ setLayout
+ ) where
+
+import Graphics.X11.Xlib ( Window )
+import XMonad
+import StackSet hiding (filter)
+import Operations
+
+-- $usage
+-- You can use this module with the following in your Config.hs file:
+--
+-- > import XMonadContrib.SetLayout
+--
+-- > , ((modMask .|. shiftMask, xK_space ), setLayout $ SomeLayout $ LayoutSelection defaultLayouts) -- %! Reset this layout
+
+-- %import XMonadContrib.SetLayout
+-- %keybind , ((modMask .|. shiftMask, xK_space ), setLayout $ SomeLayout $ LayoutSelection defaultLayouts) -- %! Reset this layout
+
+setLayout :: SomeLayout Window -> X ()
+setLayout l = do sendMessage ReleaseResources
+ windows $ \s -> s { current = r $ current s }
+ where r scr = scr { workspace = r' $ workspace scr }
+ r' ws = ws { layout = l }