3

I know gnome-control-center display changes the file ~/.config/monitors.xml. But when I restart my machine, gnome-control-center display don't remember my previous settings for dual monitors.

So I made backup of monitors.xml and just copy the backup to ~/.config/monitors.xml when my system boots.

But now I need a way to apply this settings without needing to restart lightdm/gdm or logging out of my current session, just like gnome-control-center display does.

PS: I want to make a script to set the correct settings for my dual monitor setup without the need to open gnome-control-center display everytime I boot my PC, and setting all the options again (tiring).

2
  • 1
    You can use similar solution like this one askubuntu.com/questions/52205/…. xrandr -q to list all modes and outputs.
    – user.dz
    Feb 8, 2014 at 20:57
  • 1
    Your tips help me find a solution, I will write the solution here soon. Thanks! Feb 11, 2014 at 11:22

1 Answer 1

2

I solved my problem this way:

First I setup my monitors configuration in

gnome-control-center display

Then I saved, and applied the changes.

So I ran

xrandr -q

to get my current configuration. Something like this:

Screen 0: minimum 320 x 200, current 1920 x 1980, maximum 8192 x 8192
LVDS1 connected 1600x900+0+1080 (normal left inverted right x axis y axis) 0mm x 0mm
   1600x900       60.1*+
   1440x900       59.9  
   1360x768       59.8     60.0  
   1152x864       60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 475mm x 267mm
   1920x1080      60.0*+
   1280x1024      75.0     60.0  
   1152x864       75.0  
   1024x768       75.1     60.0  
   800x600        75.0     60.3  
   640x480        75.0     60.0  
   720x400        70.1  
DP1 disconnected (normal left inverted right x axis y axis)

With this settings I created a script in ~/bin/monitors-configure

#!/bin/bash

xrandr --output LVDS1 --mode  1600x900 --pos 0x1080 --rotate normal --output VGA1 --off --output DP1 --off --output HDMI1 --mode 1920x1080 --pos 0x0 --rotate normal

Now I just run monitors-configure

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .