Disable 2nd display in login screen

Hi,

I’m on KDE Plasma 6.3.4 and Wayland. I’m trying to disable my 2nd display for the login screen - that display is shared so sometimes its available, sometimes its not.

I’ve tried disabling the 2nd dispaly and using the SDDM system settings button “Apply Plasma Settings…”, that doesn’t help.

I’ve also tried the manual steps described here, which also doesn’t work: SDDM - ArchWiki

The theme and styling are picked up properly, but not the display configuration.

The contents of the mentioned file ‘/var/lib/sddm/.config/kwinoutputconfig.json’’ are:

[
    {
        "data": [
            {
                "allowSdrSoftwareBrightness": true,
                "autoRotation": "InTabletMode",
                "brightness": 1,
                "colorPowerTradeoff": "PreferEfficiency",
                "colorProfileSource": "sRGB",
                "connectorName": "DP-2",
                "edidHash": "e39a27f83dc18a803001ab1ff7152d12",
                "edidIdentifier": "GSM 23381 16843009 1 2016 0",
                "highDynamicRange": false,
                "iccProfilePath": "",
                "mode": {
                    "height": 1080,
                    "refreshRate": 74973,
                    "width": 1920
                },
                "overscan": 0,
                "rgbRange": "Automatic",
                "scale": 1,
                "sdrBrightness": 200,
                "sdrGamutWideness": 0,
                "transform": "Normal",
                "vrrPolicy": "Automatic",
                "wideColorGamut": false
            },
            {
                "allowSdrSoftwareBrightness": true,
                "autoRotation": "InTabletMode",
                "brightness": 1,
                "colorPowerTradeoff": "PreferEfficiency",
                "colorProfileSource": "sRGB",
                "connectorName": "HDMI-A-1",
                "edidHash": "2e935981dff7367a30f100713a09b5ee",
                "edidIdentifier": "GSM 23381 16843009 1 2016 0",
                "highDynamicRange": false,
                "iccProfilePath": "",
                "mode": {
                    "height": 1080,
                    "refreshRate": 74973,
                    "width": 1920
                },
                "overscan": 0,
                "rgbRange": "Automatic",
                "scale": 1,
                "sdrBrightness": 200,
                "sdrGamutWideness": 0,
                "transform": "Normal",
                "vrrPolicy": "Automatic",
                "wideColorGamut": false
            }
        ],
        "name": "outputs"
    },
    {
        "data": [
            {
                "lidClosed": false,
                "outputs": [
                    {
                        "enabled": true,
                        "outputIndex": 0,
                        "position": {
                            "x": 0,
                            "y": 0
                        },
                        "priority": 0
                    },
                    {
                        "enabled": false,
                        "outputIndex": 1,
                        "position": {
                            "x": 1920,
                            "y": 0
                        },
                        "priority": -1
                    }
                ]
            },
            {
                "lidClosed": false,
                "outputs": [
                    {
                        "enabled": true,
                        "outputIndex": 0,
                        "position": {
                            "x": 0,
                            "y": 0
                        },
                        "priority": 0
                    }
                ]
            },
            {
                "lidClosed": false,
                "outputs": [
                    {
                        "enabled": true,
                        "outputIndex": 1,
                        "position": {
                            "x": 0,
                            "y": 0
                        },
                        "priority": 0
                    }
                ]
            }
        ],
        "name": "setups"
    }
]

Unfortunately the 2nd display also receives focus in the password input screen, which makes the login screen even annoying.

Best regards and thanks,
Simeon

1 Like

hi and welcome.

when posting text blocks like your .json file it’s much easier to read and compare with other files if you use the text block formatting provided here in the forum.

to post a code block like this use three backtick characters ``` on a single line, then paste your code.

follow with a blank line and then another line with three backticks to end the code block like this, with a line of padding at the bottom for the slider 

Thank you for the edit, for some reason I was unable to edit after posting (I got an error that I can’t post URLs).

posting links and pics is an elevated privilege and should come along shortly as you continue to post.

sorry i don’t have an answer to your actual question.

Here’s how I do it:

first: get a list of the devices name with xrandr

xrandr | grep -w connected
DP-1 connected primary 1920x1200+1600+0 (normal left inverted right x axis y axis) 518mm x 324mm
HDMI-A-3 connected 1600x1200+0+0 (normal left inverted right x axis y axis) 367mm x 275mm

warning: for some reason output names i get under wayland differ from names under x11
in my case only x11 names work ( HDMI-3 in x11, HDMI-A-3 in wayland)

now create a script /usr/share/sddm/scripts/Xsetup

sudo nano /usr/share/sddm/scripts/Xsetup

#!/bin/sh
# Xsetup - run as root before the login dialog appears

xrandr --output HDMI-3 --off

Then add the config to SDDM:

sudo nano /etc/sddm.conf

[XDisplay]
# Xsetup script path
# A script to execute when starting the display server
DisplayCommand=/usr/share/sddm/scripts/Xsetup

this could already be in sddm.conf under [X11] section, it should work without changes. add if it is not there

now reboot

this setup works for me, hope it help

1 Like

Ah, this is what I have been missing. I did find this suggestion, but I was using the xrandr output name that was printed on Wayland… Using the name printed on X11 works now.

Thank you very much!

hi, thanks for sharing this tip… it should probably be a GUI option that ships with plasma, tbh.

would it be possible to use this same approach to just rotate the screen, rather than disable it?

i assume using --rotate left instead of --off?

i don’t mind seeing the login prompt on both screens but one is portrait so it always comes up rotated which is disorienting, esp since it always seems to be the one that has the input focus right after a reboot.

perhaps i can add another --output command for the landscape monitor and give it the --primary option to force the focus there instead of the portrait monitor? would that work?

apologies for hijacking your solution, and thanks in advance for any further insights.

UPDATE: the solution i would looking for doesn’t seem to work, this is what i tried

xrandr --output DisplayPort-2 --rotate left --output DisplayPort-0 --primary

the rotation worked but messed up the baseline so the monitors no longer were aligned and the focus still went to the portrait monitor anyway, so just turning the portrait monitor off altogether seems like the better option.

i have no idea how sddm decides which monitor to focus, thats the reason i disable my second monitor at start (i tried use --primary option, but it also does not work for me)

so basicaly, don’t have any further insights :slightly_smiling_face:

1 Like