3

Recently Xmonad has started placing me on workspace #3 when it starts up. I'll often get caught off guard by this because I'll go to #2 to do something and when I switch back to #1 nothing is there.

Based on my understanding of the documentation, workspace #1 should be by default on screen #1, workspace #2 on screen #2 (if present), etc. I'm on a laptop and as far as I can tell, just after X starts xrandr reports only one connected screen. Yet for some reason, Xmonad thinks the only connected screen is screen #3.

From the xmonad manpage:

When running with multiple monitors (Xinerama), each screen has exactly 1 workspace visible. mod-{w,e,r} switch the focus between screens, while shift-mod-{w,e,r} move the current window to that screen. When xmonad starts, workspace 1 is on screen 1, workspace 2 is on screen 2, etc. When switching workspaces to one that is already visible, the current and visible workspaces are swapped.

So when I first launch xmonad, the first window I open is in workspace #3 (I would return to it by pressing mod-3) which the above indicates should only happen if I was staring at screen #3, but pressing mod-w,mod-e, or mod-r does not remove focus from the window like it would if I actually had several monitors attached.

  • What do you mean by “screen” here? This word has a technical meaning in this context, but it's extremely rarely used (they're meant to support multiple monitors, but windows can't move between screens, so everybody uses heads instead). Xrandr shows monitors and heads, which have nothing to do with workspaces. What makes you think that “Xmonad thinks the only connected screen is screen #3”, and what does that have to do with your problem with workspaces? – Gilles May 20 '17 at 12:30
  • @Gilles I'm using 'screen' in the xmonad sense of the word. i.e. where the focus goes if you hit mod-{w,e,r}. I'm using also workspace in the xmonad sense of the word, which you focus with mod-{1..10}. What I find odd is that upon first login mod-shift-return, mod-2, mod-shift-return, mod-1 leaves me staring at nothing, but if I then mod-3 I'm looking at the first terminal I opened. – Huckle May 20 '17 at 18:51
  • So if I understand your terminology correctly, you use the term head to refer to where focus goes when pressing mod-{w,e,r}. I'm just using the terminology from the xmonad man page. An interesting observation is that xmonad doesn't remove focus from the current window if I do press mod-{w,e,r}, yet it also doesn't leave me on workspace 1 when it starts up either. – Huckle May 20 '17 at 18:56
6

I just hit the same problem that my first screen (laptop) gets the second workspace and my external screen gets the third workspace.

In my situation, the problem is caused by a previously generated xmonad.state file in ~/.xmonad/. Deleting that file solves the problem.

The xmonad.state file is generated every time you press mod+q to restart xmonad during its execution. The file caused lots of issues, and should be fixed in the next release according to the latest github issue tracker https://github.com/xmonad/xmonad/pull/91

  • Damn, this has been bothering me for months now. After reading through #91 and #86 it makes perfect sense now. – Huckle Jul 30 '17 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.