summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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