summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-02-16 13:40:28 +0100
committerMatthias Schiffer <matthias@gamezock.de>2010-02-16 13:40:42 +0100
commitc00ae76a705354900f503ed85a6c9fe7cd938620 (patch)
treea65d1e067d36e254626b0b712f454b4d9ebb5db3
parente2f3a1393658bae1d8c88cacc159a7e4d1a398b8 (diff)
downloadxmonad-conf-c00ae76a705354900f503ed85a6c9fe7cd938620.tar
xmonad-conf-c00ae76a705354900f503ed85a6c9fe7cd938620.zip
Added screen switching
-rw-r--r--xmonad.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/xmonad.hs b/xmonad.hs
index be1d1e9..06a4978 100644
--- a/xmonad.hs
+++ b/xmonad.hs
@@ -3,6 +3,8 @@ import XMonad.Config.Desktop
import XMonad.Config.Gnome
import XMonad.Actions.CycleWS
import XMonad.Actions.NoBorders
+import XMonad.Actions.PhysicalScreens
+import XMonad.Actions.Warp
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.ResizableTile
@@ -12,6 +14,7 @@ import XMonad.Util.EZConfig
import Control.Monad
import Control.Monad.Trans
import Data.Monoid
+import Ratio((%))
import ConfigurableBorders
import FullscreenManager
@@ -36,6 +39,9 @@ main = xmonad $ gnomeConfig
, ("M-S-<Right>", shiftToNext)
, ("M-S-b", withFocused toggleBorder >> refresh)
, ("M1-<F4>", kill)
+ , ("M-<F1>", viewOrWarp 0)
+ , ("M-<F2>", viewOrWarp 1)
+ , ("M-<F3>", viewOrWarp 2)
]
`additionalMouseBindings`
[ ((myModMask, button4), \_ -> sendMessage Shrink)
@@ -45,6 +51,16 @@ main = xmonad $ gnomeConfig
]
+viewOrWarp :: Int -> X ()
+viewOrWarp n = do
+ XState {windowset = wset} <- get
+ i <- getScreen $ P n
+ whenJust i $ \s -> do
+ ws <- screenWorkspace s
+ whenJust ws $ \w -> windows . W.view $ w
+ when (s == (W.screen . W.current $ wset)) $ warpToScreen s (1%2) (1%2)
+
+
myStartupHook :: X ()
myStartupHook = do
startupHook gnomeConfig