XMonad IndependantScreens does not load workspaces on second Screen at startup

79 Views Asked by At

I have setup IndependantScreens in XMonad so I can have per-monitor workspaces and it was going fine until I restarted my computer and now my second monitor by default opens on 0_code (see code below to understand). Then if i move to my second monitor and switch to workspace 1 being 1_web it then works.

Is there a way to fix this?

Code:

def {
        workspaces         = withScreens 2 [ "web", "code", "spare" ],
}

This might also be relevant.

myLayout = onWorkspaces [ "1_web","1_code","1_spare" ] myVerticalLayout $ myDefaultLayout
  where
    myDefaultLayout = tall
    myVerticalLayout = three

I checked that xrandr was setting the monitors correctly before xmonad launches and it is so I am not sure what is wrong.

Xrandr output

Screen 0: minimum 8 x 8, current 3640 x 1920, maximum 32767 x 32767
DP-0 connected 1080x1920+2560+0 right (normal left inverted right x axis y axis) 544mm x 303mm
   1920x1080     60.00 + 164.92   144.00   119.98*   99.93    84.90    59.94    50.00  
DP-2 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   2560x1440    144.00 + 119.99*   59.95  
1

There are 1 best solutions below

0
On

As pointed out by Daniel Wagner this fixes the issue!

Replace

withScreens 2 ["web", "code", "spare"]

with

[marshall s vw | vw <- ["web", "code", "spare"], s <- [0, 1]]