4

I am cloning my 1920x1080 monitor display to a TV (1366x768) using a splitter device. It works fine except rebooting moves all my icons up on the desktop, forcing them into a space of the lower resolution. With the TV HDMI unplugged, the icons stay in the desired locations, and xrandr shows the chosen (marked with the asterisk *) and preferred (marked with the plus +) resolution of 1920x1080.

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
HDMI-A-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  50.00    59.94  
   1680x1050     59.88  
<snipped>

But with the TV plugged in, xrandr shows

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
HDMI-A-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 853mm x 480mm
   1366x768      59.81 +
   1920x1080     60.00*   50.00    59.94  
   1280x720      60.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94  
   720x400       70.08 

Is there a way to set the preferred '+' down to the 1920x1080 line?

ticotexas
  • 719

1 Answers1

3

(I have EDITed the answer, with a more thorough detail and testing)

There are (at least) two methods to change the preferred mode:

  1. Using X11 configuration. A little more contrived than method #2.
  2. Using xrandr. One can make these changes permanent, but "There are two disadvantages to using .xprofile for xrandr settings. First, it occurs fairly late in the startup process, so you'll see some resolution resizing during the initial screen draw; in some cases panel windows may resize improperly as a result. Second, as this is a per-user setting, it won't affect the resolutions of other users, nor will it alter the resolution on the login screen." (source).

Note that adding modes with one method and setting the active mode with another may not succeed, in particular considering the comment for method #2.


X11 configuration

Based on this and this, I put together file /usr/share/X11/xorg.conf.d/10-monitor.conf. I am using here Bodhi Linux. The location in Ubuntu is likely /etc/X11/xorg.conf.d/<something>.conf, or adding to /etc/X11/xorg.conf, see this, this and this.

Section "Monitor"
    Identifier      "Main Monitor"
    Modeline        "1344x744_60.00"   80.75  1344 1408 1544 1744  744 747 757 773 -hsync +vsync
    Modeline        "1344x768_60.00"   84.00  1344 1416 1552 1760  768 771 781 798 -hsync +vsync
    Option          "PreferredMode" "1344x744_60.00"
EndSection

Section "Screen" Identifier "Primary Screen" Device "VGA [AMD/ATI] Wrestler [Radeon HD 6310]" Monitor "Main Monitor" SubSection "Display" Modes "1344x744_60.00" "1344x768_60.00" EndSubSection EndSection

Section "Device" Identifier "VGA [AMD/ATI] Wrestler [Radeon HD 6310]" Driver "radeon" EndSection

Adapt it with the values you need for the new resolution.


.xprofile

I added file ~/.xprofile containing

xrandr --newmode "1344x768_60.00"   84.00  1344 1416 1552 1760  768 771 781 798 -hsync +vsync
xrandr --newmode "1344x744_60.00"   80.75  1344 1408 1544 1744  744 747 757 773 -hsync +vsync
xrandr --addmode LVDS "1344x768_60.00"
xrandr --addmode LVDS "1344x744_60.00"
xrandr --output LVDS --mode "1344x744_60.00" --preferred

Adapt it with the values you need for the new resolution.

Related:

  1. How to change the preferred mode on xrandr?
  2. How can I make xrandr customization permanent?
  3. https://unix.stackexchange.com/questions/125556/how-can-i-make-xrandr-changes-persist
  4. https://unix.stackexchange.com/questions/94734/how-to-modify-the-default-setting-adopted-by-xrandr-when-connecting-an-external
  5. How do I save my new resolution setting with xrandr?
  6. Best place to automatically add mode in xrandr
  7. Making xRandR Changes Permanent
  8. https://linux.die.net/man/1/cvt
  9. https://linux.die.net/man/1/gtf
  10. https://linux.die.net/man/1/xrandr
  • 1
    Simply adding it to the xorg.conf worked. (A little surprised since my system didn't even have an xorg.conf to begin with.) – Fred Hamilton Sep 29 '20 at 02:06