aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2024-01-29 14:09:33 -0700
committerJosh Rahm <rahm@google.com>2024-01-29 14:09:33 -0700
commit12335234034a16fce3d324e92030963d3ceacbc1 (patch)
tree58e8a006b19f4d6ec095a6d2cc1429efd1c3680b
parentbbe7717e629b5a265c967652a946fa7563a747ff (diff)
downloadrde-12335234034a16fce3d324e92030963d3ceacbc1.tar.gz
rde-12335234034a16fce3d324e92030963d3ceacbc1.tar.bz2
rde-12335234034a16fce3d324e92030963d3ceacbc1.zip
Add <M-a> and <S-M-a> to cycle between monitors.
This is more general than it was before. It's quicker than typing its synonymous equivalent, <M-f>,. as a bonus it's the same on both dvorak and qwerty keyboards.
-rw-r--r--src/Rahm/Desktop/Keys.hs17
-rw-r--r--src/Rahm/Desktop/Keys/Wml.hs6
2 files changed, 20 insertions, 3 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index b84a586..d55c3bc 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -154,6 +154,7 @@ import XMonad.Layout.Spacing
import XMonad.Util.Run (safeSpawn)
import XMonad.Util.WindowProperties
import Prelude hiding ((!!))
+import Graphics.X11.XScreenSaver (XScreenSaverState(ScreenSaverCycle))
type KeyMap l = XConfig l -> Map (KeyMask, KeySym) (X ())
@@ -373,6 +374,22 @@ bindings = do
ws <- readNextWorkspaceName
lift $ windows $ W.view ws
+ bind xK_a $ do
+ justMod $
+ doc "Cycle focus forward through the screens. (Synonymous with f,.)" $ do
+ runMaybeT_ $ do
+ ws' <- workspaceForStringT ",."
+ ws <- MaybeT . return $ workspaceName ws'
+ lift $ windows $ W.view ws
+
+ shiftMod $
+ doc "Cycle focus backward through the screens. (Synonymous with f;.)" $ do
+ runMaybeT_ $ do
+ ws' <- workspaceForStringT ";."
+ ws <- MaybeT . return $ workspaceName ws'
+ lift $ windows $ W.view ws
+
+
bind xK_g $ do
justMod $
doc
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs
index 61c19b2..675d56e 100644
--- a/src/Rahm/Desktop/Keys/Wml.hs
+++ b/src/Rahm/Desktop/Keys/Wml.hs
@@ -562,11 +562,11 @@ readNextWorkspaceWithHandler handle =
screens <-
mt $
map (W.tag . W.workspace . snd)
- <$> withWindowSet (return . getHorizontallyOrderedScreens)
+ <$> withWindowSet (return . reverse . getHorizontallyOrderedScreens)
- let (front, _) = break ((== workspaceName ws) . Just) (screens ++ screens)
+ let (_, rest) = break ((== workspaceName ws) . Just) (screens ++ screens)
- justWorkspace <$> MaybeT (return $ last front)
+ justWorkspace <$> MaybeT (return $ head $ tail rest)
-- The workspace with the searched for window.
(_, _, "/") ->