Xmonad有两个显示器

时间:2017-09-26 23:52:25

标签: xmonad

如何设置XMonad以使用两台显示器?我有一台笔记本电脑,当我在办公桌前时,我在HDMI端口上插了第二台显示器。

在显示器插入并激活的情况下,XMonad认为我有一个非常宽的屏幕。 I3效果很好;我有不同的工作区用于不同的监视器。

import System.IO
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.EZConfig (additionalKeys)
import XMonad.Util.Run (spawnPipe)

import qualified Data.Map as M

main =
  xmonad =<<
  xmobar
    defaultConfig
    { terminal = "alacritty"
    , manageHook = manageDocks <+> manageHook defaultConfig
    , layoutHook = avoidStruts $ layoutHook defaultConfig
    , handleEventHook = mconcat [docksEventHook, handleEventHook defaultConfig]
    , borderWidth = 2
    , modMask = mod4Mask
    , keys = mykeys
    }

mykeys :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
mykeys c = (myKeys c) `M.union` (XMonad.keys defaultConfig c)
  where
    myKeys (XConfig {modMask = modm}) = myKeyBindings modm

myKeyBindings modm = M.fromList $ []

这是我的xmonad.hs

我的xorg.conf是:

➜X11cat xorg.conf

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "None"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1@0:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
EndSection

0 个答案:

没有答案