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

Solid soliditsallgood at mailbox.org
Thu Jan 13 06:48:25 UTC 2022


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?  Having more screens for
multi-head setups is not the default behaviour.

> 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


More information about the xmonad mailing list