Search code examples
xmonad

How to make xmonad work on an external HDMI display?


I have an HP laptop that is connected to an external monitor via HDMI cable. At the moment I'm using GNOME and it is configured to turn the laptop display off and use the external monitor only. However when I start xmonad all the content displays on the laptop's monitor. I would love to turn off the laptop's monitor just like in GNOME and use the external display instead. How can I do that?enter image description here


Solution

  • You can use xrandr in a terminal to do so.

    First you type in xrandr in your terminal

    xrandr
    

    This should give you an overview of your monitors, something like this:

    Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192
    eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
       1920x1080     60.00*+  59.97    59.96    59.93    48.00
       1680x1050     59.95    59.88
       1600x1024     60.17
       ...
    HDMI-1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 598mm x 336mm
       1920x1080     60.00*+
       1600x1200     60.00
       1680x1050     59.95
       ...
    

    In my case eDP-1 is the monitor of the laptop while HDMI-1 is my external monitor.

    Now type in:

    xrandr --output <external monitor ID> --auto
    xrandr --output <laptop monitor ID> --off