Add unsupported resolution to old monitors in KDE

Aug. 7, 2018, 1:02 a.m.   wschaub   linux  


I recently grabbed an old VGA flatscreen monitor (HP 2011x) third hand to use as a second display.

Right out of the gate I had a problem: Under Ubuntu 16.04LTS KDE would not see it as anything other than a 1024x768 monitor Even though it supports 1600x900. After some playing around I think I have a way to manage things that makes sense for me under KDE.

You can use the xrandr command to dynamically add a mode to any attached display so we just create a shell script that runs early in the startup of KDE that can run it for us before things like kscreen start. then we can use the normal display settings control panel to set our display mode and orientation for us.

This is the script that I came up with for my HP 2011x. You can make your own modeline by using the cvt command.

In my particular case I used cvt -r 1600 900 60

$HOME.config/plasma-workspace/env/hp2011x.sh

#!/bin/bash
xrandr --newmode "1600x900" 97.50  1600 1648 1680 1760  900 903 908 926 +hsync -vsync
xrandr --addmode VGA-1-1 1600x900

For your particular monitor ID you will want to run xrandr and take note of the name of the monitor that doesn't list the resolution you need to set and change the name from VGA-1-1 to its name in your own script.

Now log out and then log back in to KDE and you should be able to configure your screen.

If .config/plasma-workspace/env doesn't exist you can just create it. You can also manage this inside settings under Startup and Shutdown. which might look something like this:

KDE Startup settings

*EDIT*

I'm fairly sure the reason I needed to mess with all of this in the first place was the fact that I used an extremely old VGA cable from a junk pile that is missing some pins that would otherwise talk to the monitor and get the correct mode information from it. Still if you have an ancient VGA display or got stuck with an old cable I hope these notes were helpful at least.

*EDIT2*

After more investigation and a different cable it turns out that Nvidia optimus and using nvidia-prime was the real culprit. I'm using the nvidia driver instead of the open source driver and using prime-select to switch between intel and nvidia cards in my T530. in addition to not loading monitor information on the VGA port HDMI audio also breaks. switching to either card in the BIOS instead of optimus makes everything work as expected.


xrandr KDE xorg