0

I have Linux Mint 20 installed on my PC. Please, please, don't mark this as duplicate, I know people have asked this everywhere but believe me, THEIR SOLUTIONS DON'T WORK. So, I have two monitors, one runs at 1366x768, that's my main one, the other runs at 1360x768. The former works no issues, the latter only shows 1024x768 and 800x600 resolutions, there's no way to set it' actual native one. I have an intel integranted GPU. So I searched a bit and found some solutions involving xrandr. They said to use cvt to get a Modeline (????) and use xrandr to add it to the list of resolutions. This worked at first, but while the resolution appeared on the list, selecting it showed the display a bit shifted to the left, so the screen was cut off and there was black space on the right (which I could not hover over with my mouse, mind you). I couldn't find a solution for this, so I continued with the guide which said that this was temporary and would be reset upon restarting the PC, and it showed a way to make it permanent.

It involved shutting down the Xserver and creating an x config file which we can then add the "Modeline" lines to on the "Monitor" sections. He also explained that we should add a line on every "Screen" section and subsection that said "Mode 1360x768". So I did. After that I had to move the file to /etc/X11... that did absolutely nothing.

Messing around again with xrandr I found out that the commands that used to work before don't work now. They give me the following error:

X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  16 (RRCreateMode)
  Serial number of failed request:  45
  Current serial number in output stream:  45

So I can't even use that now. Then my main monitor started to mess up, the screen was shifted to the center of the screen, and a copy of it was next to it, like a mosaic. I had to restart the lightdm service a couple of times and edit my .xprofile file to make it return to normal... and here we are.

Why is it so god damn hard to change the resolution of a monitor? I really want to like linux but I don't find any reasonable explanation as to why is this a thing in 2020.

5
  • Are you running X or Wayland? Run loginctl to find your session id, then loginctl show-session -pType ${id} (replacing ${id} as appropriate). Jun 19, 2020 at 7:35
  • Both return nothing. I think I have x tho.
    – tralph3
    Jun 19, 2020 at 8:25
  • You need to replace all of ${id}: loginctl show-session -pType 3. Jun 19, 2020 at 8:35
  • Yeah that was it, I got X11.
    – tralph3
    Jun 19, 2020 at 8:42
  • @tralph3 Was this answered with Stephen's commands? If so, please consider writing up a proper Answer (below) to indicate the steps you took to solve the problem. Thank you!
    – Jeff Schaller
    Jun 20, 2021 at 13:05

1 Answer 1

0

So, the Modeline is a string that specifies a bunch of details of the resolution, like offsets, the resolution itself, and some other stuff. There's three steps to add a resolution, first you create a new mode with a given Modeline with xrandr --newmode <modeline>, then, you add that newly created mode to some display adapater, you can get a list of display adapters and connected ones with xrandr. Then, to add the mode use xrandr --admode <adapter> <mode>. So, if the mode is named "1360x768", and the display adapter's name is VGA-1, the command would look like so:

xrandr --addmode VGA-1 1360x768

Then you just set it

xrandr --output VGA-1 --mode 1360x768

That should do it.

The reason I was getting black bars and stuff was that the Modeline I was using wasn't correct for my display. I found the apporpiate one in this modeline database, specifically, this modeline "1360x768" 85.500 1360 1424 1536 1792 768 771 777 795 +Hsync +Vsync. The quoted part of the modeline is the name. You can change that to whatever.

The reason I was getting an error afterwards, was that there was already a mode with the same name (I was trying to add another modeline with the same name, so it wasn't working). That should cover everything here.

So, this question derives from my previous ignorance on how this worked, hope it helps somebody.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .