[SOLVED] Dual monitor and correct resolution at startup

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ovehendrix

[SOLVED] Dual monitor and correct resolution at startup

Post by ovehendrix »

Hi all

I'm trying to get my system (linux mint 14 cinnamon with intel hd graphics ironlake/clarkdale) to use the correct resolution after startup. I have a dual monitor system with one 24" monitor(HDMI1) and a 50" plasma (HDMI2), for now i'm executing this script manually after startup to get the correct resolution (the system boots into something like 1600x900 for the HDMI1 and not HDMI2 at all):

Code: Select all

#!/bin/bash
#MONITOR - HDMI1
xrandr --output HDMI1 --mode 1920x1200

#TV - HDMI2
xrandr --output HDMI2 --mode 1280x768
xrandr --output HDMI2 --right-of HDMI1
The script works perfectly but i'cant get it to autoload at startup. I've tried to add this to rc.local:

Code: Select all

#!/bin/sh -e
sleep 5
sh /home/ove/res_fix.sh
exit 0
This doesn't work and adding the xrandr commandos directly to rc.local doesn't work. I've also tried adding the script to ~/.config/autostart/ without success.

Is it a way to get this working? I've looked at configuring xorg.conf to my setup but I rather just have a easy method to autoload the script that already works.

xrandr output:

Code: Select all

Screen 0: minimum 320 x 200, current 3200 x 1200, maximum 8192 x 8192
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200      60.0*+
   1600x1200      60.0  
   1680x1050      59.9  
   1680x945       60.0  
   1400x1050      59.9  
   1600x900       60.0  
   1280x1024      75.0     60.0  
   1440x900       75.0     59.9  
   1280x960       60.0  
   1366x768       60.0  
   1360x768       60.0  
   1280x800       74.9     59.9  
   1152x864       75.0  
   1280x768       74.9     60.0  
   1024x768       75.1     70.1     60.0  
   1024x576       60.0  
   832x624        74.6  
   800x600        72.2     75.0     60.3     56.2  
   848x480        60.0  
   640x480        72.8     75.0     66.7     60.0  
   720x400        70.1  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 connected 1280x768+1920+0 (normal left inverted right x axis y axis) 1000mm x 550mm
   1280x768       60.0*+   74.9     60.4  
   1920x1080      60.0     50.0     30.0     24.0     30.0     25.0  
   1680x1050      59.9  
   1680x945       60.0  
   1400x1050      74.9     59.9  
   1600x900       60.0  
   1280x1024      75.0     60.0  
   1440x900       75.0     59.9  
   1280x960       60.0  
   1366x768       60.0  
   1360x768       59.8  
   1280x800       74.9     59.9  
   1152x864       75.0  
   1280x720       60.0     50.0     59.7  
   1440x576       25.0  
   1024x768       75.0     70.1     60.0  
   1024x576       60.0  
   800x600        72.2     75.0     60.3  
   720x576        50.0  
   848x480        60.0  
   720x480        59.9  
   640x480        75.0     72.8     60.0     59.9     59.9  
   720x400        70.1  
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
ovehendrix

Re: Dual monitor and correct resolution at startup

Post by ovehendrix »

Update:

Tried editing ~/.config/monitors.xml after reading some post in the forum which gave some rare screen splitting

Image

monitors.xml:

Code: Select all

<monitors version="1">
  <configuration>
      <clone>yes</clone>
      <output name="VGA1">
      </output>
      <output name="HDMI1">
          <vendor>SAM</vendor>
          <product>0x02b6</product>
          <serial>0x48553234</serial>
          <width>1920</width>
          <height>1200</height>
          <rate>60</rate>
          <x>0</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
      <output name="DP1">
      </output>
      <output name="HDMI2">
          <vendor>GSM</vendor>
          <product>0xc3b2</product>
          <serial>0x01010101</serial>
          <width>1280</width>
          <height>768</height>
          <rate>60</rate>
          <x>0</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>no</primary>
      </output>
      <output name="HDMI3">
      </output>
      <output name="DP2">
      </output>
      <output name="DP3">
      </output>
  </configuration>
</monitors>
I've also tried adding changing .xprofile to this without success:

Code: Select all

xrandr --output HDMI1 --mode 1920x1200
xrandr --output HDMI2 --mode 1280x768
xrandr --output HDMI2 --right-of HDMI1
ovehendrix

Re: Dual monitor and correct resolution at startup

Post by ovehendrix »

I finaly solved it :) the only thing that works was to add the xrandr commands at the beginning of /etc/mdm/Init/Default

Code: Select all

PATH=/usr/bin:$PATH
OLD_IFS=$IFS

xrandr --output HDMI1 --mode 1920x1200
xrandr --output HDMI2 --mode 1280x768
xrandr --output HDMI2 --right-of HDMI1
No need for a script at all! credits
Locked

Return to “Graphics Cards & Monitors”