24

I have an ultra wide screen, 21:9 resolution, AOS. There's no option for 21:9 in the Ubuntu display settings though so I have to have the monitor set to 16:9 which kind of defeats the purpose of having an ultra-wide screen! If the monitor is set to 21:9 the desktop is stretched significantly.

Anyone know how to add the 21:9 settings into Ubuntu?

Jorge Castro
  • 73,717
fronk
  • 341

8 Answers8

16

Along the lines of this, I was able to find some information:

This link helped me.

In short: run xrandr and cvt like you did, then create the following file:

/usr/share/X11/xorg.conf.d/10-monitor.conf

In the file change the parameters in < > according to your specs:

Section "Monitor"
  Identifier "Monitor0"
  <INSERT MODELINE HERE>
EndSection
Section "Screen"
  Identifier "Screen0"
  Device "<INSERT DEVICE HERE>"
  Monitor "Monitor0"
  DefaultDepth 24
  SubSection "Display"
    Depth 24
    Modes "<INSERT MODENAME HERE>"
  EndSubSection
EndSection

Here's what you should do:

For the modeline, first run this command:

cvt <X> <Y> <R>

Where XxY is your resolution and R is your refresh rate.

To test the resolution, first do this:

xrandr --newmode <MODELINE>

Be sure to remove the Modeline keyword.

Then, copy the output and replace the placeholder with it.

For the device, run xrandr|tail -n+2|head -n1|cut -d\ -f1, and replace the placeholder with its output. Keep the quotes.

For the modename, run cvt <X> <Y> <R>|cut -d\ -f2, replacing the last placeholder with the output of this command. As before, keep the quotes.

After that, do this:

xrandr --addmode <DEVICE> <MODENAME>

Replace <DEVICE> and <MODENAME> appropriately. Then, to test your resolution, do this:

xrandr --output <DEVICE> --mode <MODENAME>

If you encounter problems with the new resolution, please log out and then back in (worst case scenario: press Ctrl+Alt+Delete and then Enter to sign out.)

If you didn't encounter problems, save the file, then restart X. To do this, first press Ctrl+Alt+F1, login as an 'Administrator' account, then run these commands:

killall Xorg
X
EKons
  • 779
5

For a while i used an ultrawide LG Screen

I've had some luck using cvt to generate custom modelines which pushed the refresh up to 44hz which seemed to be a sweet spot in terms of being the most my graphics card (intel 4000 + GeForce GT 750M in optimus) could output reliably. It will take around 10 to 20 seconds to sync and if you have the refresh rate too high the screen will periodically blank and resync. If it doesn't work it will not damage your monitor like the old CRT's did so experiment away. I was able to get 44hz to stay synced solidly all day.

The cable that came with my monitor could not handle this but the 'amazon basics high speed hdmi with ethernet' cable i bought for a few quid could so its worth trying a few cables if this isn't working straight away.

display port is the best choice over hdmi if you have the option, if you use display port you need to change the port identifier in this script.

If you use HDMI you might need to ensure your monitor is in HDMI 1.4a or HDMI2 mode if it supports it, the default HDMI 1.3 sometimes isn't enough for superwide screens.

Heres the script i wrote for setting up my screen, it should work for any combinations of resolutions, just edit the RESOLUTION line.

#!/bin/bash

# setup my massive monitor at 45hz if its plugged in

RESOLUTION="3440 1440 44" 
OUTPUT="HDMI-0"

CONNECTED=$(xrandr --current | grep -i $OUTPUT | cut -f2 -d' ')

if [ "$CONNECTED" = "connected" ]; then
    MODELINE=$(cvt $RESOLUTION | cut -f2 -d$'\n')
    MODEDATA=$(echo $MODELINE | cut -f 3- -d' ')
    MODENAME=$(echo $MODELINE | cut -f2 -d' ')

    echo "Adding mode - " $MODENAME $MODEDATA
    xrandr --newmode $MODENAME $MODEDATA
    xrandr --addmode $OUTPUT $MODENAME
    xrandr --output $OUTPUT --mode $MODENAME
else
    echo "Monitor is not detected"
fi

Experiment with this until you have a stable setting , then you follow the procedure described by @Έρικ Κωνσταντόπουλος to add it to your xorg setup.

FWIW i returned my ultrawide screen and went for 4k ilyama 40 incher which is a 16:9 as i preferred more hight. It was cheaper as well.

Amias
  • 5,359
2

For Nvidia Cards

  1. IMPORTANT: Ensure you're using a display port cable from your PC to your monitor.

  2. Then you need the proper drivers:

  3. After you reboot launch the Nvidia Control Panel from the dash. The latest versions of the Nvidia drivers include native support for 21:9, on my system it just worked:

enter image description here

Jorge Castro
  • 73,717
1

I'm using Elementary OS, based on Ubuntu.. I have a Ultra Wide monitor (LG 29") and the maximum I had in my display was 1920x1080 (16:9) which makes everything oval (not good).

So using the following commands, I've added the 2560x1080 (21:9) and it got much better! Check the link bellow for the source and reference:


# Get more details about my display
xrandr

AND

cvt 2560 1080 50

Then

sudo xrandr --newmode "2560x1080_50.00"  188.75  2560 2712 2976 3392  1080 1083 1093 1114 -hsync +vsync

sudo xrandr --addmode eDP-1 "2560x1080_50.00"

Source: https://medium.com/@AbhiXpert/add-change-the-custom-resolution-of-your-display-using-xrandr-on-ubuntu-18-04-in-a-minute-338caec6e29

It worked for me and hope it help you guys

0

use Xrandr: cvt or gtf "(x axis) (y axis) (refresh rate)"

input the Output of the above command

xrandr --newmode "(resolution output of gtf or cvt)"

xrandr --addmode "(connection) (Xaxis)x(Yaxis)_(refresh rate)"

don't forget you need a HDMI 2.1 cord... you'll get weird timings otherwise I've had the screen tear in half, checkerboarding across the screen.

0

Adding to EKons answer for Ubuntu 20.4 (as I can't comment).

I tried to use the permanent 10-monitor.conf file setup, but was unable to login after as it led me to a login-bootloop. Also happened after trying to change file permissions. Only way out was to delete the file via console or start Ubuntu using wayland.

Another issue was the naming of the config that was not supported so I had to shorten it.

My none-permanent solution is now a bash script that was made executable and looks like this:

#!/bin/bash

xrandr --newmode "5120_30" 292.75 5120 5360 5888 6656 1440 1443 1453 1468 -hsync +vsync xrandr --addmode HDMI-1 5120_30 xrandr --output HDMI-1 --mode 5120_30

0

I don't have enough rep to respond to hamx0r's comment.

but I was able to overcome this error by editing

/etc/X11/xorg.conf.d/10-nvidia-custom.conf

and adding this:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    Option         "ModeValidation" "AllowNonEdidModes,NoMaxPClkCheck,NoEdidMaxPClkCheck,NoMaxSizeCheck,NoHorizSyncCheck,NoVertRefreshCheck,NoVirtualSizeCheck"
EndSection

(and then restarting the X session by logging out).

I found this solution by talking to an LLM; its explanation is that this disables some checks that the NVIDIA driver does to filter out some invalid modes.

-1

There is nothing to do, it should just work out of the box. Just plug the HDMI cable, and the screen should work.

Please have a look at the screenshot below. enter image description here

On the left, the default 1366x768 screen of the laptop. On the right, the 21:9 screen. See that the resolution and ratio is detected on the display setup.

The laptop is a Lenovo E531, with a Core i5, with integrated Intel GPU. No extra graphic card.

ttoine
  • 1,200