How can I run kscreen-doctor on startup before login (to disable my external TV screen from showing login dialog)?

Hi all!

I am running KDE 6.2.4 on Fedora 41, already tried asking over in the Fedora forum, but unfortunately did not get any response, so I am hoping you guys can help me out :slight_smile:

In addition to my monitor, I have a TV screen that I don’t use very often. I would like to only enable it as a display on demand via a script which also launches other gaming stuff on that TV. From disabled state, this works fine with “kscreen-doctor output.HDMI-A-1.enable”.

However, when I shutdown the system, the screen is always enabled on next boot and displays the login screen.

Is there a way to run something like “kscreen-doctor output.HDMI-A-1.disable” on boot, or before the login screen is setup? Or any other way to disable the output and enable it later with a command?

I have tried following sddm documentation and placing a file in /etc/sddm.conf.d/ which contains
[X11]
DisplayCommand=kscreen-doctor output.HDMI-A-1.disable

…but this does not seem to get triggered. Replacing the command with “/bin/touch /tmp/testfile” does nothing so I guess this never gets executed.

Any ideas on how to run stuff on boot/before login?

Thanks and gave a great day!

this sounds like it may require a kernel level intervention.

blacklist the monitor on boot, but then some how enable it after on demand.

don’t even now if this is possible, just spitballing.

Hi, great idea! I tried to disable the output on boot by adding this to the boot command line:
video=HDMI-1:d

…but then the TV stays dead and I cannot find a way to reactivate it at all :frowning:

ur half way there… farther than i would have got. :upside_down_face:

SDDM doesn’t run on Xorg on Fedora.

To do what you want, you don’t have to run any commands or the like. There’s a button in the system settings page for SDDM to synchronize settings to it - that includes (the Wayland sessions) display settings. In your session, just create whatever display setup you want SDDM to have, and then synchronize the settings to it.

2 Likes

Amazing, never noticed that button, but that did the trick, thank you for your help! Finally I can login via the correct screen.

No matter where I looked, I was not able to find a way to configure this via CLI. Would you by chance have any idea where the relevant config could be located, and point me in the right direction?

The config for display settings is in ~/.config/kwinoutputconfig.json of each user. I don’t know where the SDDM user’s data is stored though.