I wanted to share a solution for a common issue that some users might face with KDE 5. I personally encountered it across multiple Linux distributions that use KDE 5, so it’s not specific to MX Linux.
The issue:
When using dual monitors, the second screen often shows a black desktop — only the task manager appears, and nothing else is visible.
Temporary workaround I used:
I used to fix it manually by pressing [Super + P] to toggle between display modes. Once I changed the mode, the desktop would load normally on the second screen.
Permanent solution:
I explained the issue to ChatGPT and asked it to create a script that could automate this fix. After a few adjustments, the script worked perfectly.
All you need to do is add the script to KDE’s Autostart settings and make sure it’s executable.
Here’s the script:
Code: Select all
#!/bin/bash
sleep 2
kscreen-doctor output.65.enable
kscreen-doctor output.65.primary
sleep 2
kscreen-doctor output.67.enable
kscreen-doctor output.67.primary
kscreen-doctor output.65.disable
To find the correct screen IDs (like [output.65], [output.67], etc.), you can run the following command in the terminal:
Code: Select all
kscreen-doctor -o
Example output from my system:
Code: Select all
Output: 65 eDP-1 disabled connected ...
Output: 66 DP-1 disabled disconnected ...
Output: 67 HDMI-1 enabled connected ...
[output.65] is my laptop screen (eDP-1)
[output.67] is my external monitor (HDMI-1)
So, the script enables the laptop screen briefly, sets it as primary (which helps KDE "wake up" the desktop), then switches to the external screen and disables the laptop display.
Thanks for your time!