[xmonad] Strange workspace switching bug in my config

Leo Alekseyev dnquark at gmail.com
Sun May 13 07:27:19 CEST 2012


Hi all,
A couple of years back I made the following addition to my xmonad.hs:
instead of 10 workspaces, it admits 20 workspaces, logically arranged
in two rows of 10.  I think of it as having a "scratch" workspace for
every main workspace, and I use up/down arrows to switch between the
main and the scratch workspace.  For instance, if you are on workspace
4, Mod4-<down> will move to workspace 4SCR and Mod4-<up> will move
back to workspace 4.

Recently this config started misbehaving (without any changes to
xmonad.hs, but with possible changes in xmonad/GHC version to 0.10 and
7.4.1 as my system was upgraded).  In particular, in the example
above, now Mod4-<down> moves from workspace 4 to workspace 3SCR and
Mod4-<up> then moves from 3SCR to 2.  To fix it, I have to log in and
out of X, but the problem always reoccurs, possibly after sleep/resume
cycle(?).

The embarrassing thing here is that I haven't touched Haskell in a
while, and barely grok my config anymore, so I don't know where to
start troubleshooting.  The code I described seems straightforward
enough, so it's my hope that maybe someone here can tell me what is
going on without too much effort...

The relevant parts of my config are below, and the full file in its
horrifying glory is at http://hpaste.org/68453.  If someone seems
something obviously amiss, please shout...

--leo

myWorkspaces = ["1:terminals", "2:emacs", "3:web", "4", "5", "6",
"7","8","9","0"] ++ map (\x -> show x ++ "SCR") ([1..9]++[0])
.....

zeroSub 0 = 10
zeroSub x = x

jumpToMain = gets windowset >>= \W.StackSet { W.current = W.Screen {
W.workspace = w } } -> withNthWorkspace W.greedyView (-1+(zeroSub $
read [head(W.tag w)]))
jumpToScratch = gets windowset >>= \W.StackSet { W.current = W.Screen
{ W.workspace = w } } -> withNthWorkspace W.greedyView (9+(zeroSub $
read [head(W.tag w)]))

....
          , ("M-<Up>", jumpToMain)
             , ("M-<Down>", jumpToScratch)



More information about the xmonad mailing list