aboutsummaryrefslogtreecommitdiffstats
path: root/DeManage.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-07-18 22:31:07 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-07-18 22:31:07 +0200
commitd4db7a72e886ac0958a856901a110a285d6761cb (patch)
tree288d8f26c543e3eb19845c08f9a042d7b2270ac9 /DeManage.hs
parent5f8d68a7f9cfa9b8a41df84d9c086edb99b92a20 (diff)
downloadXMonadContrib-d4db7a72e886ac0958a856901a110a285d6761cb.tar.gz
XMonadContrib-d4db7a72e886ac0958a856901a110a285d6761cb.tar.xz
XMonadContrib-d4db7a72e886ac0958a856901a110a285d6761cb.zip
Add XMonadContrib.DeManage: a module for unmanaging windows (like panels)
darcs-hash:20070718203107-a5988-9c945556e897e410cc1f14df81782547cf51828a.gz
Diffstat (limited to '')
-rw-r--r--DeManage.hs52
1 files changed, 52 insertions, 0 deletions
diff --git a/DeManage.hs b/DeManage.hs
new file mode 100644
index 0000000..3f638f6
--- /dev/null
+++ b/DeManage.hs
@@ -0,0 +1,52 @@
+{-# OPTIONS -fglasgow-exts #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module : XMonadContrib.DeManage
+-- Copyright : (c) Spencer Janssen <sjanssen@cse.unl.edu>
+-- License : BSD3-style (see LICENSE)
+--
+-- Maintainer : Spencer Janssen <sjanssen@cse.unl.edu>
+-- Stability : unstable
+-- Portability : unportable
+--
+-- This module provides a method to cease management of a window, without
+-- unmapping it. This is especially useful for applications like kicker and
+-- gnome-panel.
+--
+-- To make a panel display correctly with xmonad:
+--
+-- * Determine the pixel size of the panel, add that value to defaultGaps
+-- * Launch the panel
+-- * Give the panel window focus, then press mod-d
+-- * Convince the panel to move/resize to the correct location. Changing the
+-- panel's position setting several times seems to work.
+--
+-----------------------------------------------------------------------------
+
+module XMonadContrib.DeManage (
+ -- * Usage
+ -- $usage
+ demanage
+ ) where
+
+import qualified StackSet as W
+import XMonad
+import Operations
+import Control.Monad.State
+
+-- $usage
+-- To use demanage, add this import:
+--
+-- > import XMonadContrib.GreedyView
+--
+-- And add a keybinding to it:
+--
+-- > , ((modMask, xK_d ), demanage)
+--
+
+-- | Stop managing the current focused window.
+demanage :: X ()
+demanage = do
+ ws <- gets windowset
+ modify (\s -> s { windowset = maybe ws (flip W.delete ws) (W.peek ws) })
+ refresh