Save display settings for specific monitor

display-settingsxfcexrandr

When I'm connecting an external Monitor to my notebook (specs below), whether with VGA or Displayport, I always have to configure the screen resolution and display position. At the moment I'm doing this with an GUI utility for XRandR called arandr. Another issue is, that always the lowest possible display resolution is used, instead of the highest, when connecting a monitor.

Is it possible to automatically recall a previously made configuration every time I connect a specific monitor? For example, when I connect the monitor at work, I want the displays setup side-by-side; at home instead, I use a vertical layout.

This problem exists with both of my laptops. They are running Fedora 18 and Xubuntu 13.04, all with XFCE as Window Manager. They are the same devices, Lenovo X220, with the integrated Intel HD3000 graphics.

Update

I tried to make a per monitor setting, but unfortunately fedora don't use a xorg.conf file , instead it tries to do an automatic configuration every time X is started (see create xorg.conf)
Creation of xorg.conf file with Xorg :1 -configure, like described in the fedora wiki, fails with Number of created screens does not match number of detected devices.
.

Workaround

I've made a little workaround that solves the problem, but only for displays connected at the displayport. Arandr can save the display setup as shell script, so i used the saved settings and putted them into the .xinitrc.

cat ~/.screenlayout/<name_of_your_settingsfile>.sh > ~/.xinitrc

chmod u+x ~/.xinitrc

That should do the trick, if someone has a better way to do it, please let me know.

Best Answer

I found this thread with a solution titled: How Do I Save Xrandr Settings?, that might help you:

You can use this command to get your current settings:

$ xrandr --verbose

Using that command you could figure out what your current display is set to and put the following example types of lines in your $HOME/.xinitrc file:

xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode HDMI1 1920x1080_60.00
Related Question