Within of the most common problems that I encountered when I first migrate to Ubuntu was the topic of screen resolutions and a few additional hardware detection issues, I'm talking about 10 years ago, I had a gaming rig back then.
For this I used 3 monitors and used the ports of the graphics card and additional to it with the port of the motherboard, which in Windows is possible more without on the other hand in Linux I have not been able to do it.
Anyway it is not something that requires for it as many of you will know, all possible resolutions are emulated in Windows while on Linux only the right ones so to speak so when I wanted to make mirror screens I ran into a big problem, since when using the VGA ports it only displayed certain resolutions while with DVI and HDMI other things that I generate conflict.
For this I found Xrandr a small tool that helped me solve my problems. In this case we must have all the monitors that we are going to use or if it is only one we have no problem.
In the first step we are going to enable one more resolution to our monitor settings, first we verify the option we want to have with our monitor and our graphics card, in my case I am interested in enabling 1280 × 1024 resolution.
Now it is important to check what resolutions our monitor can support as well as what frequency it works on.
Already investigated this, with this data we obtain them with this syntax:
gtf 1280 1024 70
This command line threw me something like the following:
# 1280×1024 @ 70.00 Hz (GTF) hsync: 63.00 kHz; pclk: 96.77 MHz Modeline “1280x1024_70.00” 96.77 1152 1224 1344 1536 864 865 868 900 -HSync +Vsync
What interests us is the following:
96.77 1152 1224 1344 1536 864 865 868 900 -HSync +Vsync
Before it alone we must execute the following in terminal:
Where we will show information about our monitors, here we will identify them, in my case I have VGA-0 DVI-1 and HDMI-1
After getting the data to add to the screen modes we proceed to add these modes as follows, adding what the previous command gave us:
xrandr --newmode “1280x1024_70.00″ 96.77 1152 1224 1344 1536 864 865 868 900 -HSync +Vsync
After executing this previous line, which added the new resolution mode of our Screen, we execute the following command line, I will add the resolution to the HDMI and DVI monitors:
xrandr --addmode DVI-1 1280x1024_70.00 xrandr --addmode HDMI-1 1280x1024_70.00
And finally we proceed to enable the resolutions
xrandr --output DVI-1 --mode 1280x1024_70.0 xrandr --output HDMI-1 --mode 1280x1024_70.0
With this last command line we have enabled the resolution mode that we want in our Ubuntu and we can choose it from System> Preferences> Monitors or we can enable it simply by executing this command line (in my case):
xrandr -s 1280x1024_70.0
Finally I can only comment that This process is only valid during our session that we have so when restarting the system the applied changes are not saved, to solve this problem we can create a script that runs at startup.
Or we can make use of the following, we open the following file and edit:
sudo gedit /etc/gdm/Init/Default
We will look for the following lines:
And just below them, in my case I add the following:
xrandr --newmode “1280x1024_70.00″ 96.77 1152 1224 1344 1536 864 865 868 900 -HSync +Vsync xrandr --addmode DVI-1 1280x1024_70.00 xrandr --addmode HDMI-1 1280x1024_70.00 xrandr --output DVI-1 --mode 1280x1024_70.0 xrandr --output HDMI-1 --mode 1280x1024_70.0
Another is to create a bash that executes the same commands, but in my case I stick with the above.
#!/bin/bash # setting up new mode xrandr --newmode “1280x1024_70.00″ 96.77 1152 1224 1344 1536 864 865 868 900 -HSync +Vsync xrandr --addmode DVI-1 1280x1024_70.00 xrandr --addmode HDMI-1 1280x1024_70.00 xrandr --output DVI-1 --mode 1280x1024_70.0 xrandr --output HDMI-1 --mode 1280x1024_70.0 ##sleep 1s ##done
I am not an expert creating bash, but it would be something like that, if anyone wants to support to perfect it they would be appreciated.
As far as possible, it remains for me a solution that over time has not ceased to be effective, if you know of any other method or application, do not hesitate to share it as I will be very grateful to you.