diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2015-09-17 12:00:09 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2015-09-17 12:00:09 +0200 |
commit | 20737092d502b9d08634093465382efd7a15f98a (patch) | |
tree | 4c4a613719efc523b932964fc8601477d4b5a2bc | |
parent | 1c814510508ce2b9f46210fb3b5646841a76d598 (diff) | |
download | xmonad-config-20737092d502b9d08634093465382efd7a15f98a.tar.gz xmonad-config-20737092d502b9d08634093465382efd7a15f98a.tar.xz xmonad-config-20737092d502b9d08634093465382efd7a15f98a.zip |
Do not switch to default config if depth is out of range
-rw-r--r-- | xmonad.hs | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -60,7 +60,7 @@ import XMonad.Util.Replace (replace) import Control.Monad (when) import System.Environment (getArgs) -import Data.Maybe (fromMaybe, fromJust, isNothing, isJust, mapMaybe) +import Data.Maybe (fromMaybe, fromJust, isNothing, isJust, mapMaybe, listToMaybe) import Data.Ord (comparing) -- for hostname handling (no windows key on "Australien") @@ -531,6 +531,13 @@ myKeys c hostname = "Australien" -> "M-S-q" _ -> "M-M5-q" + -- Like X.A.TopicSpace.switchNthLastFocused but defaults to do nothing + -- if depth is too big and not to switch to the default topic. + switchNthLastFocused :: TopicConfig -> Int -> X () + switchNthLastFocused tg depth = do + ws <- fmap (listToMaybe . drop depth) getLastFocusedTopics + whenJust ws $ switchTopic tg + myMouse modm c = [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w >> snapMagicMove (Just 50) (Just 50) w)) |