
Felix Blanke [2010.10.10 1046 +0200]:
Hi,
are you sure that it doesn't work with only one screen?
Your are right here. This function will work on single screen, even though it won't do what you want (the first invisible screen would be the one listed first). However, Adam is right to the point that the pattern match of "prm" *can* fail under some circumstances, namely when you run this with less than two workspaces. This, however, would be a change in your xmonad.hs, and that means you should inspect everything else in your setup for correctness anyway. Cheers, Norbert
Even with only one screen "getSortByXineramaRule" returns a list with 9 workspaces (I'm using 9 workspaces) in it, right? Logicaly the sorting after the let is wrong then, but there should be no error.
But like I said: I'm a haskell noob, maybe I'm totaly wrong :)
How would I add that fallback? You wrote some ], but I'm not sure how such a fallback looks @haskell
myXineramaSorter = do srt <- getSortByXineramaRule let prm (one:two:rest) = two:one:rest return (prm . srt)
Felix
On 09. October 2010 - 20:18, Adam Vogt wrote:
Date: Sat, 9 Oct 2010 20:18:58 -0400 From: Adam Vogt
To: xmonad@haskell.org Subject: Re: [xmonad] ppVisible with 3 screens * On Friday, October 08 2010, Felix Blanke wrote:
Hello,
thanks a lot for your work!
It works :) The short version
"let prm (one:two:rest) = two:one:rest"
is enough, because I only need to switch the first two elements. With this hack I don't need the colour thing.
Thanks again!
Regards, Felix
If you end up using that config with only one screen, that expression will throw an exception. XMonad will most likely catch it, but the recovery is to try again. Arguably xmonad should do something smarter, but until something changes there, you'd get an infinite loop.
So add a fallback case to the definition:
] let prm (one:two:rest) = two:one:rest ] prm x = x
-- Adam _______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad ---end quoted text---
xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
-- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments