aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MagicFocus.hs11
-rw-r--r--MetaModule.hs1
2 files changed, 12 insertions, 0 deletions
diff --git a/MagicFocus.hs b/MagicFocus.hs
new file mode 100644
index 0000000..444a100
--- /dev/null
+++ b/MagicFocus.hs
@@ -0,0 +1,11 @@
+module XMonadContrib.MagicFocus (magicFocus) where
+
+import XMonad
+import StackSet
+
+magicFocus l = l { doLayout = \s -> (doLayout l) s . swap
+ , modifyLayout = \x -> fmap magicFocus `fmap` modifyLayout l x }
+
+swap :: Stack a -> Stack a
+swap Empty = Empty
+swap (Node f u d) = Node f [] (reverse u ++ d)
diff --git a/MetaModule.hs b/MetaModule.hs
index 4f52783..5357e33 100644
--- a/MetaModule.hs
+++ b/MetaModule.hs
@@ -22,6 +22,7 @@ import XMonadContrib.FindEmptyWorkspace ()
import XMonadContrib.GreedyView ()
import XMonadContrib.HintedTile ()
import XMonadContrib.LayoutHints ()
+import XMonadContrib.MagicFocus ()
import XMonadContrib.Mosaic ()
import XMonadContrib.NamedWindows ()
import XMonadContrib.NoBorders ()