I have a laptop, which is often connected to an external monitor, which mirrors the laptop screen. In the past, sddm would display on the external monitor, if connected. It no longer does.
Based on some googling, I tried adding
services.xserver.displayManager.setupCommands = "
xrandr --output eDP-1 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-A-1 --mode 1920x1080 --pos 0x0 --rotate normal
";
based on
❯ xrandr | grep connected
HDMI-A-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 820mm x 460mm
eDP-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
```
but that didn’t help. What do I need to do to make this work? I imagine it may have to do with wayland.enable = true, which probably bypasses xserver?
Thanks
Thanks
1 Like
FWIW, the external monitor seems to be detected, and activated, in the boot process:
❯ grep HDMI-A-1 <(journalctl -b)
Apr 13 09:27:14 nixos sddm-helper-start-wayland[1519]: "[09:27:14.591] DRM: EDID for the following head fails conformity:\nBlock 1, CTA-861 Extension Block:\n Audio Data Block: Audio Format Code 0x00 is reserved.\n\n[09:27:14.591] DRM: head 'HDMI-A-1' found, connector 351 is connected, EDID make 'VIZIO, Inc', model 'E371VL', serial 'LAUKHJKM00000'\n Supported EOTF modes: SDR\n Supported colorimetry modes: default\n Supported VRR modes: (none), \n"
Apr 13 09:27:14 nixos sddm-helper-start-wayland[1519]: "[09:27:14.591] associating input device event7 with output eDP-1 (none by udev)\n[09:27:14.591] associating input device event5 with output eDP-1 (none by udev)\n[09:27:14.591] associating input device event0 with output eDP-1 (none by udev)\n[09:27:14.591] associating input device event10 with output eDP-1 (none by udev)\n[09:27:14.591] Output 'eDP-1' enabled with head(s) eDP-1\n[09:27:14.591] Setting output 'HDMI-A-1' to color AUTO format\n"
Apr 13 09:27:14 nixos sddm-helper-start-wayland[1519]: "[09:27:14.591] Output 'HDMI-A-1' attempts EOTF mode SDR and colorimetry mode default.\n[09:27:14.591] Output 'HDMI-A-1' using color profile: stock sRGB color profile\n"
Apr 13 09:27:14 nixos sddm-helper-start-wayland[1519]: "[09:27:14.592] Output HDMI-A-1 (crtc 185) video modes:\n 1920x1080@60.0, preferred, current, 148.5 MHz\n 1920x1080@60.0 16:9, 148.5 MHz\n 1920x1080@59.9 16:9, 148.4 MHz\n 1920x1080@50.0 16:9, 148.5 MHz\n 1920x1080@24.0 16:9, 74.2 MHz\n 1280x720@60.0, 74.2 MHz\n 1280x720@60.0 16:9, 74.2 MHz\n 1280x720@59.9 16:9, 74.2 MHz\n 1280x720@50.0 16:9, 74.2 MHz\n 1024x768@75.0, 78.8 MHz\n 1024x768@70.1, 75.0 MHz\n 1024x768@60.0, 65.0 MHz\n 800x600@75.0, 49.5 MHz\n 800x600@72.2, 50.0 MHz\n"
Apr 13 09:27:14 nixos sddm-helper-start-wayland[1519]: " 800x600@60.3, 40.0 MHz\n 720x576@50.0 16:9, 27.0 MHz\n 720x480@60.0 16:9, 27.0 MHz\n 720x480@59.9 16:9, 27.0 MHz\n 640x480@75.0, 31.5 MHz\n 640x480@60.0 4:3, 25.2 MHz\n 640x480@59.9, 25.2 MHz\n 640x480@59.9 4:3, 25.2 MHz\n 720x400@70.1, 28.3 MHz\n[09:27:14.592] Output 'HDMI-A-1' enabled with head(s) HDMI-A-1\n[09:27:14.592] Compositor capabilities:\n arbitrary surface rotation: yes\n screen capture uses y-flip: yes\n cursor planes: yes\n arbitrary resolutions: no\n view mask clipping: yes\n explicit sync: yes\n color operations: yes\n color representation: yes\n presentation clock: CLOCK_MONOTONIC, id 1\n presentation clock resolution: 0.000000001 s\n"
Apr 13 09:27:15 nixos sddm-greeter-qt6[1531]: Adding view for "HDMI-A-1" QRect(1920,0 1920x1080)
Never-the-less, the external monitor displays a blank screen.
Well there is which could do the trick depending when that command is executed: NixOS Search
Otherwise you should be able to configure the compositor command: nixpkgs/nixos/modules/services/display-managers/sddm.nix at 54170c54449ea4d6725efd30d719c5e505f1c10e · NixOS/nixpkgs · GitHub
For a reference how it is set look here: nixpkgs/nixos/modules/services/display-managers/sddm.nix at 54170c54449ea4d6725efd30d719c5e505f1c10e · NixOS/nixpkgs · GitHub
Then you only need to figure out how to setup a second monitor using that compositor (probably weston) as it is the default.
Thanks, but I had already looked through that, and it is totally unclear to me how it helps. The startup does seem to pay attention to xrandr settings, but I already put that in the setup commands.