[xmonad] Strange workspace switching bug in my config

wagnerdm at seas.upenn.edu wagnerdm at seas.upenn.edu
Tue May 15 04:19:11 CEST 2012


Quoting Leo Alekseyev <dnquark at gmail.com>:

> On Sun, May 13, 2012 at 8:45 AM, Norbert Zeh <nzeh at cs.dal.ca> wrote:
>>> 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)]))
>>
>> The math here looks all wrong, and I'm surprised that it worked at  
>> all before.

The math looks fine to me, and in fact your suggestion:

>> What you want, I think, is the following:
>>
>> jumpToMain = gets (W.tag . W.workspace . W.current . windowset)
>>         >>= W.greedyView . toMain
>>  where
>>    toMain ws = [head ws]
>>
>> jumpToScratch = gets (W.tag . W.workspace . W.current . windowset)
>>            >>= W.greedyView . toScratch
>>  where
>>    toScratch ws | length ws == 1 = ws ++ "SCR"
>>                 | otherwise      = ws

is the one that looks dodgy to me. Notice that his main workspace  
names are things like "3:web", but the SCR-version is just "3SCR"! In  
fact, I would humbly suggest that this paragraph:

>>> 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(?).

...suggests that the problem won't be divined just by looking at his  
config. Something deeper is going wrong than his Haskell abilities. I  
can't say I have a better suggestion, but you could check:

1. if downgrading to older display drivers fixes the problem
2. if the permissions of ~/.xmonad and its contents look reasonable  
(and there's free disk space there)
3. how xmonad's $PATH and your shell's $PATH compare (and hence how  
the ghc that xmonad sees and the ghc that your shell sees compare)

You might also want to check the output of ghc-pkg check. (I don't  
include this in the list because I can't see a way that a broken  
package could lead to the behavior he's seeing.)

Good luck!
~d



More information about the xmonad mailing list