Workspace ordering and DynamicWorkspaces (+ patch)

I use DynamicWorkspaces with a few predefined workspaces. The problem is that when creating a new workspace, it gets sorted before my predefined workspaces and thus I can't always have e.g. "web" on Mod+1. When searching for this issue I found the following patch: http://www.haskell.org/pipermail/xmonad/2012-July/012810.html I've been using it successfully since then, and in my opinion this new behavior makes much more sense. My question is, does anyone know why the patch hasn't been merged yet? Is there anything I can do to get it merged? Note that I don't have anything to do with the patch, all credits goes to the original author Matthew Hague. Cheers, and great work with the 0.11 release! Hans

On Sun, Jan 6, 2013 at 6:27 PM, Hans Chen
I use DynamicWorkspaces with a few predefined workspaces. The problem is that when creating a new workspace, it gets sorted before my predefined workspaces and thus I can't always have e.g. "web" on Mod+1.
When searching for this issue I found the following patch: http://www.haskell.org/pipermail/xmonad/2012-July/012810.html I've been using it successfully since then, and in my opinion this new behavior makes much more sense. My question is, does anyone know why the patch hasn't been merged yet? Is there anything I can do to get it merged?
Note that I don't have anything to do with the patch, all credits goes to the original author Matthew Hague.
Hi Hans, It helps to point out that you find the patch to be useful, since the change isn't unequivocally "better". For example, the workspace ordering I have (due XMonad.Actions.TopicSpace) puts the most recently used workspaces first. That's closer to what the current ordering getSortByIndex does than Matthew's patch. So I wouldn't be surprised if there are people who prefer the current behavior. So we can choose to do: 0. nothing 1. apply Matthew's patch as-is Making the result of getSortByIndex configurable by one of these methods: 2. store the function using XMonad.Util.ExtensibleState, which can set to the right one using a startupHook (or elsewhere). 3. passing the actual function as a parameter (or as part of another argument like XMonad.Hooks.DynamicLog.PP) 4. something else? Another note is that some other modules will be affected (benefit?) by the change to getSortByIndex: Actions/CycleWS.hs Actions/WorkspaceNames.hs Actions/SwapWorkspaces.hs Hooks/EwmhDesktops.hs Hooks/DynamicLog.hs Prompt/Workspace.hs Unless there are some objections, I will apply the patch (option 1) in a week. -- Adam

Hi Adam,
Thank you so much for your answer! Hopefully people will chime in if
they're negatively affected by the patch.
Thanks,
Hans
On Sun, Jan 6, 2013 at 9:55 PM, adam vogt
On Sun, Jan 6, 2013 at 6:27 PM, Hans Chen
wrote: I use DynamicWorkspaces with a few predefined workspaces. The problem is that when creating a new workspace, it gets sorted before my predefined workspaces and thus I can't always have e.g. "web" on Mod+1.
When searching for this issue I found the following patch: http://www.haskell.org/pipermail/xmonad/2012-July/012810.html I've been using it successfully since then, and in my opinion this new behavior makes much more sense. My question is, does anyone know why the patch hasn't been merged yet? Is there anything I can do to get it merged?
Note that I don't have anything to do with the patch, all credits goes to the original author Matthew Hague.
Hi Hans,
It helps to point out that you find the patch to be useful, since the change isn't unequivocally "better". For example, the workspace ordering I have (due XMonad.Actions.TopicSpace) puts the most recently used workspaces first. That's closer to what the current ordering getSortByIndex does than Matthew's patch. So I wouldn't be surprised if there are people who prefer the current behavior.
So we can choose to do:
0. nothing 1. apply Matthew's patch as-is
Making the result of getSortByIndex configurable by one of these methods:
2. store the function using XMonad.Util.ExtensibleState, which can set to the right one using a startupHook (or elsewhere). 3. passing the actual function as a parameter (or as part of another argument like XMonad.Hooks.DynamicLog.PP) 4. something else?
Another note is that some other modules will be affected (benefit?) by the change to getSortByIndex:
Actions/CycleWS.hs Actions/WorkspaceNames.hs Actions/SwapWorkspaces.hs Hooks/EwmhDesktops.hs Hooks/DynamicLog.hs Prompt/Workspace.hs
Unless there are some objections, I will apply the patch (option 1) in a week.
-- Adam

Hi All, To follow up, I just pushed: Wed Jul 4 00:27:26 CEST 2012 matthewhague at zoho.com * order-unindexed-ws-last Changes the WorkspaceCompare module's comparison by index to put workspaces without an index last (rather than first). Regards, Adam

Great, thanks! :) Matt On Sun, Jan 13, 2013 at 09:39:04PM -0500, adam vogt wrote:
Hi All,
To follow up, I just pushed:
Wed Jul 4 00:27:26 CEST 2012 matthewhague at zoho.com * order-unindexed-ws-last
Changes the WorkspaceCompare module's comparison by index to put workspaces without an index last (rather than first).
Regards, Adam

Many thanks Adam, and of course thanks Matthew for the patch!
Hans
On Mon, Jan 14, 2013 at 3:58 AM, Matthew Hague
Great, thanks! :)
Matt
On Sun, Jan 13, 2013 at 09:39:04PM -0500, adam vogt wrote:
Hi All,
To follow up, I just pushed:
Wed Jul 4 00:27:26 CEST 2012 matthewhague at zoho.com * order-unindexed-ws-last
Changes the WorkspaceCompare module's comparison by index to put workspaces without an index last (rather than first).
Regards, Adam

On 14 January 2013 11:49, Hans Chen
Many thanks Adam, and of course thanks Matthew for the patch!
Sorry, for the noobness, but I don't understand that if this patch it's already in the 0.11 or not. In whichever case, I'm supposed to see the changes just by using the X.A.DynamicWorskpace module? Regards, -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/

As far as I know, it's not in 0.11 (I had to apply the patch manually). You'll have to wait for 0.12 or use darcs. The patch is not specific to X.A.DynamicWorkspace (it affects X.U.WorkspaceCompare), but you'll notice it when creating a new workspace yes. Hope that helps, Hans On Mon, Jan 14, 2013 at 7:42 PM, Pablo Olmos de Aguilera C. < pablo@glatelier.org> wrote:
On 14 January 2013 11:49, Hans Chen
wrote: Many thanks Adam, and of course thanks Matthew for the patch!
Sorry, for the noobness, but I don't understand that if this patch it's already in the 0.11 or not.
In whichever case, I'm supposed to see the changes just by using the X.A.DynamicWorskpace module?
Regards, -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/

On 14 January 2013 21:50, Hans Chen
As far as I know, it's not in 0.11 (I had to apply the patch manually). You'll have to wait for 0.12 or use darcs.
Considering the time took between versions, I rather use darcs. I thinks it's time to learn.
The patch is not specific to X.A.DynamicWorkspace (it affects X.U.WorkspaceCompare), but you'll notice it when creating a new workspace yes.
Yes, indeed with the darcs version works that way.
Hope that helps, Hans
Thanks :) A couple of months ago, you started a similar thread[1], it derived in a sort-of offtopic discussion, but there were a very interesting part, that you might find useful. ---- myDzenPP = defaultPP { .... , ppSort = getSortByMyRule ..... } ---- ---- -- First show visible screens, then invisible screens with more -- recently visited ones earlier. I'd also like to see the empty -- invisible ones, in a different colour. myWorkspaceCompare :: Bool -> X WorkspaceCompare myWorkspaceCompare phy = do w <- gets windowset return $ \ a b -> case (isOnScreen a w, isOnScreen b w) of (True, False) -> LT (False, True) -> GT (True, True) -> cmpPosition phy w a b (False, False) -> comparing (recentlySeen w) a b where recentlySeen w t = case findIndex (t==) $ map (W.tag . W.workspace) (W.visible w) of Just n -> n Nothing -> length (W.visible w) allScreens w = W.current w : W.visible w isOnScreen a w = a `elem` map (W.tag . W.workspace) (allScreens w) tagToSid s x = W.screen $ fromJust $ find ((== x) . W.tag . W.workspace) s cmpPosition False w a b = comparing (tagToSid $ allScreens w) a b cmpPosition True w a b = comparing (rect.(tagToSid $ allScreens w)) a b where rect i = let (Rectangle x y _ _) = screens !! fromIntegral i in (y,x) screens = map (screenRect . W.screenDetail) $ sortBy (comparing W.screen) $ W.current w : W.visible w getSortByMyRule = mkWsSort $ myWorkspaceCompare True ---- That part was from Jacek Generowitz xmonad.hs[2], and does basically what it says in the comment. Sadly, the whole file expired, so I could post what I found in my ~/.xmonad directory. Sorry for the OT, but the famous issue with the ICCCM patch it's on 0.11 or darcs? or it hasn't been applied? For future reference, where I am supposed to look if I have this kind of doubts? [1]: http://www.haskell.org/pipermail/xmonad/2012-October/013083.html [2]: http://www.haskell.org/pipermail/xmonad/2012-October/013095.html Regards, -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/
participants (4)
-
adam vogt
-
Hans Chen
-
Matthew Hague
-
Pablo Olmos de Aguilera C.