0

I would like to be able to use my ultrawide monitor as a normal widescreen monitor from time to time; instead of my desktop being at the native resolution of 3440x1440, I'd like a desktop of 2560x1440, using the central 2560 columns of the monitor and ignoring the rest:

Desired setup

I am using the NVidia video driver, and the i3 window manager.

I have tried to accomplish this with xrandr. I found promising posts such as this one which would appear to be recipes for doing so. But if I try:

xrandr --fb 2560x1440 --output DP-0 --panning 2560x1440 --mode 2560x1440

then the monitor appears to be in 2560x1440 mode, with the desktop stretched across the whole monitor.

If I try to add a mode as suggested:

$ cvt 2560 1440 60                                                                                                                                                                                  
# 2560x1440 59.96 Hz (CVT 3.69M9) hsync: 89.52 kHz; pclk: 312.25 MHz
Modeline "2560x1440_60.00"  312.25  2560 2752 3024 3488  1440 1443 1448 1493 -hsync +vsync
$ xrandr --newmode WEIRD2 312.25  2560 2752 3024 3488  1440 1443 1448 1493 -hsync +vsync
$ xrandr --addmode DP-0 WEIRD
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  18 (RRAddOutputMode)
  Serial number of failed request:  41
  Current serial number in output stream:  42

I believe this (inability to add a mode and assign it to the display - BadMatch) is an issue regarding the NVidia driver, and I couldn't see a workaround.

I got closer using the nvidia-settings application. It has an underscan mode. I used the following settings:

Nvidia-settings

This is very close; I see a 2560x1440 area in the middle of the monitor, and there's no panning evident, but the X session still seems to be seeing a wider desktop, which is truncated on the right.

Result of nvidia-settings

Can I do something with Xrandr to fix this desktop size? If I try xrandr --fb 2560x1440, I get xrandr: specified screen 2560x1440 not large enough for output DP-0 (3440x1440+0+0).

Finally, as a workaround I can use i3-gaps and set the horizontal gaps to be 440 pixels. However, full screen mode for any window uses the whole monitor which is still not ideal.

Here's the output from xrandr.

Here's the output from xrandr -v.

And the output from nvidia-settings -q all.

Is what I am trying to do possible, including being able to swap back and forth at will?

Edited to add:

Output from hwinfo --monitor --gfxcard

Output from sudo lshw -C display

Output from cvt 2560 1440:

# 2560x1440 59.96 Hz (CVT 3.69M9) hsync: 89.52 kHz; pclk: 312.25 MHz Modeline "2560x1440_60.00" 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync

Output from gtf 2560 1440 60:

# 2560x1440 @ 60.00 Hz (GTF) hsync: 89.40 kHz; pclk: 311.83 MHz Modeline "2560x1440_60.00" 311.83 2560 2744 3024 3488 1440 1441 1444 1490 -HSync +Vsync

Coljac
  • 585
  • A note since this question still gets a lot of attention. I ultimately handled this in i3 with i3-gaps, so I just have a hot key to make the effective width narrower than the monitor as depicted. It's instant, and configurable per workspace. – Coljac Nov 27 '23 at 02:31

1 Answers1

0

To remove the BadMatch error you may try adding/changing in file xorg.conf, under Section "Monitor", HorizSync 30-90, VertRefresh 55-76, or perhaps alternative setting (what is your current setting?), and reboot (source).

You may also try removing the last argument to cvt, and let it choose it for you. Please post the output.

You may try also options xrandr ... --set ..., source, source and --scale, source.

For some, nvidia-settings worked, YMMV.

You may also try with the nouveau driver. Perhaps not a definitive answer, but it may help.

In the meantime, please post the output of

$ hwinfo --monitor --gfxcard
$ sudo lshw -C display
$ cvt 2560 1440
$ gtf 2560 1440 60

Related:

  1. Changing to a lower screen resolution without stretching
  2. How do you change the preferred resolution with xrandr?
  • Thanks for the detailed suggestions. I appended the additional info to the question. The use of --set 'underscan' also did not work, xrandr responds with X Error of failed request: BadName (named color or font does not exist). Nouveau isn't an option. I'll test the xorg.conf/reboot suggestion later. – Coljac Dec 06 '21 at 11:23
  • @Coljac - What about the suggestion of editing xorg.conf? What are your current settings? Please post in the question. – sancho.s ReinstateMonicaCellio Dec 07 '21 at 09:40