Trouble with Display Layout in SDDM

Good Evening,

I’ve recently installed NixOS on an Asus laptop configured with a ScreenPad, which is a touchpad that also acts as a second screen.

The displays of this laptop are configured as follows:

$ xrandr | grep ' connected'
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
HDMI-A-2 connected 1080x540+420+1080 right (normal left inverted right x axis y axis) 60mm x 130mm

eDP-1 is the primary display for the laptop, with HDMI-A-2 being the screenpad.

In KDE Plasma, I am able to disable the screenpad when desired, or reconfigure it to be positioned as it is in windows (centered at the bottom of the screen, see above), however, this configuration does not apply until I have logged in, so the screenpad displays an awkward vertical sddm until that point. Following this tutorial has led me to add this configuration to my configuration.nix:

config.services.xserver.displayManager.setupCommands=''
  #!/bin/sh
  # Xsetup - run as root before the login dialog appears
  xrandr --output eDP-1 --mode 1920x1080
  xrandr --output HDMI-A-2 --off
  '';

However, this doesn’t seem to be called on boot, as the sddm display layout remains unchanged. COuld someone explain what, if anything, I’m doing wrong with this config? Thanks.

1 Like

After further investigation, the Config option used does not seem to be creating the correct option in sddm.conf. The script is being added here, which I believe isn’t called until an x11 user session is created:

#sddm.conf
[X11]
DisplayCommand=/nix/store/...-Xsetup

Whereas it should be called when sddm is initially run. What option should I use to have the command run as soon as sddm runs?

I have the same issue and I’ve noted the exact behavior. I’m brand new to Nixos and in no position to offer a solution, but it is troubling to me that no one has bothered to answer your question.

Were you able to resolve?

No, I’m afraid I’ve had no luck yet. The legacy sddm start commend option didn’t work either, iirc.