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.


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. .


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.

2 Answers 2


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
  • Thanks for the answer but i think this solution is connection and not monitor specific. The output of xrandr --verbose looks a little bit different, than shown in the most tutorials, f.e.: HDMI1 connected 1920x1080+0+0 (0xc0) normal (normal left inverted right x axis y axis) 160mm x 90mm
    – klingt.net
    Jun 6, 2013 at 7:38

In 2021, autorandr solves the problem for me. See this answer for full details: https://askubuntu.com/a/1130337/28301

You must log in to answer this question.

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