[xmonad] managehook: How to shift apps to a screen in dual-head?

mito info at mito-space.com
Thu Jan 13 15:50:57 UTC 2022


Thanks for your response!

Am 13.01.22 um 07:48 schrieb Solid:
> Hi,
>
> On Wed, Jan 12 2022 22:40, mito wrote:
>> I got a proper dual-head xrandr configuration with one monitor in
>> landscape view and one in portrait view. So in xmonad I have 2x10
>> workspaces, which is fine.
> Are you using IndependentScreens or something?
Well, no, though I read about it.

But I do have:

import qualified Graphics.X11.Xinerama

> Having more screens for multi-head setups is not the default behaviour.
Yeah, I am not sure if I understand that completely; it seems to me 
"screen" is the xmonad term for "monitor" or 'physical display', right?

On the other hand, maybe "screen" might be the combined 'view port' of 
all connected displays I am currently looking at; I guess that's the 
xinerama thing (and why the same wallpaper is shared [and not repeated 
on each monitor]). – Call me a dummy, but that's still not quite clear 
to me though I consulted xmonad docs and configurations; hence I am 
asking...

>> But how to initially shift programs to workspaces on a specific
>> monitor (in myManageHook)?
> There is screenWorkspace[1] to get the workspace of some monitor, which
> could then be used in a manageHook as normal
>
>      -- for monitor 1 (≡ the second one; we are 0-indexed)
>      appName =? "my-app" --> maybe mempty doShift =<< liftX (screenWorkspace 1)
>
>    Tony
>
> [1]: https://hackage.haskell.org/package/xmonad-0.17.0/docs/XMonad-Operations.html#v:screenWorkspace
>
Boy, I am way outdated~
I thought it was rather "className", and "XMonad.Operations" is part of 
the core module then?

So one just optionally needs an additional 'liftX screenWorkspace' hook? 
Sounds great!
And compiles well. – But yet it has no effect, whatever screenWorkspace 
{0,1} (or {app,class}Name) I choose: the workspace fits, but the monitor 
selection is ignored.



More information about the xmonad mailing list