diff options
author | nicolas.dudebout <nicolas.dudebout@gatech.edu> | 2012-01-23 00:58:43 +0100 |
---|---|---|
committer | nicolas.dudebout <nicolas.dudebout@gatech.edu> | 2012-01-23 00:58:43 +0100 |
commit | 6f0f5ce628bfaa8988c07f6067dfd7a81f77390c (patch) | |
tree | 16c2de1e6265cc0504e7750cb5af26480dd987e4 /XMonad/Util | |
parent | f3fbc9bac8c7b8b489f576dedcae154b488a1f4b (diff) | |
download | XMonadContrib-6f0f5ce628bfaa8988c07f6067dfd7a81f77390c.tar.gz XMonadContrib-6f0f5ce628bfaa8988c07f6067dfd7a81f77390c.tar.xz XMonadContrib-6f0f5ce628bfaa8988c07f6067dfd7a81f77390c.zip |
Adding use case for namedScratchpad.
Ignore-this: 44201e82bcd708cd7098f060345400f1
darcs-hash:20120122235843-358d5-68faf2afbfa56393817e6ef2ceaedc891da101ba.gz
Diffstat (limited to 'XMonad/Util')
-rw-r--r-- | XMonad/Util/NamedScratchpad.hs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/XMonad/Util/NamedScratchpad.hs b/XMonad/Util/NamedScratchpad.hs index 6fc226d..c3e0452 100644 --- a/XMonad/Util/NamedScratchpad.hs +++ b/XMonad/Util/NamedScratchpad.hs @@ -24,12 +24,14 @@ module XMonad.Util.NamedScratchpad ( namedScratchpadAction, allNamedScratchpadAction, namedScratchpadManageHook, - namedScratchpadFilterOutWorkspace + namedScratchpadFilterOutWorkspace, + namedScratchpadFilterOutWorkspacePP ) where import XMonad import XMonad.Hooks.ManageHelpers (doRectFloat) import XMonad.Actions.DynamicWorkspaces (addHiddenWorkspace) +import XMonad.Hooks.DynamicLog (PP, ppSort) import Control.Monad (filterM) import Data.Maybe (listToMaybe) @@ -160,4 +162,20 @@ namedScratchpadManageHook = composeAll . fmap (\c -> query c --> hook c) namedScratchpadFilterOutWorkspace :: [WindowSpace] -> [WindowSpace] namedScratchpadFilterOutWorkspace = filter (\(W.Workspace tag _ _) -> tag /= scratchpadWorkspaceTag) +-- | Transforms a pretty-printer into one not displaying the NSP workspace. +-- +-- A simple use could be: +-- +-- > logHook = dynamicLogWithPP . namedScratchpadFilterOutWorkspace $ defaultPP +-- +-- Here is another example, when using "XMonad.Layout.IndependentScreens". +-- If you have handles @hLeft@ and @hRight@ for bars on the left and right screens, respectively, and @pp@ is a pretty-printer function that takes a handle, you could write +-- +-- > logHook = let log screen handle = dynamicLogWithPP . namedScratchpadFilterOutWorkspacePP . marshallPP screen . pp $ handle +-- > in log 0 hLeft >> log 1 hRight +namedScratchpadFilterOutWorkspacePP :: PP -> PP +namedScratchpadFilterOutWorkspacePP pp = pp { + ppSort = fmap (. namedScratchpadFilterOutWorkspace) (ppSort pp) + } + -- vim:ts=4:shiftwidth=4:softtabstop=4:expandtab:foldlevel=20: |