summaryrefslogtreecommitdiffstats
path: root/MetaTile/Config.hs
diff options
context:
space:
mode:
Diffstat (limited to 'MetaTile/Config.hs')
-rw-r--r--MetaTile/Config.hs23
1 files changed, 14 insertions, 9 deletions
diff --git a/MetaTile/Config.hs b/MetaTile/Config.hs
index 71706d8..b553bd4 100644
--- a/MetaTile/Config.hs
+++ b/MetaTile/Config.hs
@@ -20,7 +20,7 @@
--
------------------------------------------------------------------------
-module MetaTile.Config (defaultConfig, Default(..)) where
+module MetaTile.Config (Default(..)) where
--
-- Useful imports
@@ -34,7 +34,10 @@ import qualified MetaTile.Core as MetaTile
,layoutHook,modMask,terminal,normalBorderColor,focusedBorderColor,defaultBorderWidth,focusFollowsMouse
,handleEventHook,clickJustFocuses,rootMask,frameMask,clientMask)
+import Prelude hiding (Floating)
import MetaTile.Layout
+import MetaTile.Layout.Floating
+import MetaTile.Layout.LayoutModifier
import MetaTile.Operations
import qualified MetaTile.StackSet as W
import Data.Bits ((.|.))
@@ -128,7 +131,7 @@ startupHook = return ()
-- | The available layouts. Note that each layout is separated by |||, which
-- denotes layout choice.
-layout = tiled ||| Mirror tiled ||| Full
+layout = floating $ tiled ||| Mirror tiled ||| Full
where
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
@@ -209,6 +212,9 @@ keys conf@(XConfig {MetaTile.modMask = modMask}) = M.fromList $
, ((modMask, xK_h ), sendMessage Shrink) -- %! Shrink the master area
, ((modMask, xK_l ), sendMessage Expand) -- %! Expand the master area
+ -- floating layer support
+ , ((modMask, xK_t ), withFocused sink) -- %! Push window back into tiling
+
-- increase or decrease number of windows in the master area
, ((modMask , xK_comma ), sendMessage (IncMasterN 1)) -- %! Increment the number of windows in the master area
, ((modMask , xK_period), sendMessage (IncMasterN (-1))) -- %! Deincrement the number of windows in the master area
@@ -237,12 +243,16 @@ keys conf@(XConfig {MetaTile.modMask = modMask}) = M.fromList $
-- | Mouse bindings: default actions bound to mouse events
mouseBindings :: XConfig Layout -> M.Map (KeyMask, Button) (Window -> X ())
mouseBindings (XConfig {MetaTile.modMask = modMask}) = M.fromList
+ -- mod-button1 %! Set the window to floating mode and move by dragging
+ [ ((modMask, button1), \w -> focus w >> mouseMoveWindow w)
-- mod-button2 %! Raise the window to the top of the stack
- [ ((modMask, button2), windows . (W.shiftMaster .) . W.focusWindow)
+ , ((modMask, button2), windows . (W.shiftMaster .) . W.focusWindow)
+ -- mod-button3 %! Set the window to floating mode and resize by dragging
+ , ((modMask, button3), \w -> focus w >> mouseResizeWindow w)
-- you may also bind events to the mouse scroll wheel (button4 and button5)
]
-instance (a ~ Choose Tall (Choose (Mirror Tall) Full)) => Default (XConfig a) where
+instance (a ~ ModifiedLayout Floating (Choose Tall (Choose (Mirror Tall) Full))) => Default (XConfig a) where
def = XConfig
{ MetaTile.workspaces = workspaces
, MetaTile.layoutHook = layout
@@ -264,11 +274,6 @@ instance (a ~ Choose Tall (Choose (Mirror Tall) Full)) => Default (XConfig a) wh
, MetaTile.rootMask = rootMask
}
--- | The default set of configuration values itself
-{-# DEPRECATED defaultConfig "Use def (from Data.Default, and re-exported by MetaTile and MetaTile.Config) instead." #-}
-defaultConfig :: XConfig (Choose Tall (Choose (Mirror Tall) Full))
-defaultConfig = def
-
-- | Finally, a copy of the default bindings in simple textual tabular format.
help :: String
help = unlines ["The default modifier key is 'alt'. Default keybindings:",