[xmonad] Issue 439 in xmonad: suggestion: CycleWS should export the screenBy function

codesite-noreply at google.com codesite-noreply at google.com
Sun Mar 6 22:56:23 CET 2011


Status: New
Owner: ----

New issue 439 by linusar... at gmail.com: suggestion: CycleWS should export  
the screenBy function
http://code.google.com/p/xmonad/issues/detail?id=439

Reference: http://www.haskell.org/pipermail/xmonad/2011-January/011029.html

 From a Haskell perspective, if CycleWS exports the screenBy function, then  
a user can go from (the default):

      -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
      -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
      --
      [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows .  
f))
          | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
          , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]

  to the more flexible

      -- mod-{w,e}, Switch to previous/next Xinerama screen
      -- mod-shift-{w,e}, Move client to previous/next Xinerama screen
      --
      [((m .|. modm, key), (screenWorkspace =<< sc) >>= flip whenJust  
(windows . f))
          | (key, sc) <- zip [xK_w, xK_e] [(screenBy (-1)),(screenBy 1)]
          , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]


It surprises me that such a useful little function is not exported already.

So, the patch is a one-liner change:
--- CycleWS.hs	2011-02-21 20:48:25.000000000 -0800
+++ CycleWS-new.hs	2011-03-06 13:53:10.000000000 -0800
@@ -56,6 +56,7 @@
                                , shiftPrevScreen
                                , swapNextScreen
                                , swapPrevScreen
+                              , screenBy

                                  -- * Moving between workspaces, take two!
                                  -- $taketwo




More information about the xmonad mailing list