aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Hooks
diff options
context:
space:
mode:
authorSpencer Janssen <spencerjanssen@gmail.com>2009-10-23 05:46:30 +0200
committerSpencer Janssen <spencerjanssen@gmail.com>2009-10-23 05:46:30 +0200
commit073cc91641642c9ee760e5c3453a767b23c9ddc7 (patch)
tree676a3631caa2b3a7ffd5d5239b63f62016cf2efd /XMonad/Hooks
parent36728ae60e3effdfe645a9a34cfd2e1067a37516 (diff)
downloadXMonadContrib-073cc91641642c9ee760e5c3453a767b23c9ddc7.tar.gz
XMonadContrib-073cc91641642c9ee760e5c3453a767b23c9ddc7.tar.xz
XMonadContrib-073cc91641642c9ee760e5c3453a767b23c9ddc7.zip
Add ewmh function to set all EWMH settings in one step
Ignore-this: 4d79c1e156f56882036ce43e70cce6f2 darcs-hash:20091023034630-25a6b-3a5055d46b632bd7c898e2904f145718f392bd6e.gz
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r--XMonad/Hooks/EwmhDesktops.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs
index f263941..724cc13 100644
--- a/XMonad/Hooks/EwmhDesktops.hs
+++ b/XMonad/Hooks/EwmhDesktops.hs
@@ -15,6 +15,7 @@
module XMonad.Hooks.EwmhDesktops (
-- * Usage
-- $usage
+ ewmh,
ewmhDesktopsStartup,
ewmhDesktopsLogHook,
ewmhDesktopsLogHookCustom,
@@ -39,13 +40,18 @@ import XMonad.Util.WorkspaceCompare
-- > import XMonad
-- > import XMonad.Hooks.EwmhDesktops
-- >
--- > main = xmonad defaultConfig { startupHook = ewmhDesktopsStartup
--- > , handleEventHook = ewmhDesktopsEventHook
--- > , logHook = ewmhDesktopsLogHook }
+-- > main = xmonad $ ewmh defaultConfig
--
-- You may also be interested in 'avoidStruts' from XMonad.Hooks.ManageDocks.
+-- | Add EWMH functionality to the given config. See above for an example.
+ewmh :: XConfig a -> XConfig a
+ewmh c = c { startupHook = startupHook c +++ ewmhDesktopsStartup
+ , handleEventHook = handleEventHook c +++ ewmhDesktopsEventHook
+ , logHook = logHook c +++ ewmhDesktopsLogHook }
+ where x +++ y = mappend x y
+
-- |
-- Initializes EwmhDesktops and advertises EWMH support to the X
-- server
@@ -57,7 +63,6 @@ ewmhDesktopsStartup = setSupported
-- of the current state of workspaces and windows.
ewmhDesktopsLogHook :: X ()
ewmhDesktopsLogHook = ewmhDesktopsLogHookCustom id
-
-- |
-- Generalized version of ewmhDesktopsLogHook that allows an arbitrary
-- user-specified function to transform the workspace list (post-sorting)