Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to save my monitor settings? I have an external monitor at work, but each morning i have to plug it in, rearrange the windows from being side by side to being on top of each other. Can I just save this?

share|improve this question

Configuration for all your monitors - hot-plugged or not - should be stored in $HOME/.config/monitors.xml by the xrandr plugin for gnome-settings-daemon, which is what actually applies the configuration you make in the Monitors capplet.

Since it seems that this isn't working properly for everyone, there's clearly a bug somewhere. Urgh.

share|improve this answer
Yeah, and as maco says, if i shut off the computer and boot it back up, it remembers, just not when it's already on. – Oscar Godson Oct 12 '10 at 16:39

First three steps to connect your external monitor the way you want and 4th is to save the settings.

  1. Connect your external monitor and check its supported resolution:

    xrandr -q
  2. Give the following command (This will disable your laptop monitor):

    xrandr --output LVDS1 --off --output TV1 --off --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal
  3. If you want both laptop and external enabled:

    xrandr --output LVDS1 --mode yyyyXzzzz --pos 0x0 --rotate normal --output TV1 --off --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal

    (yyyyXzzzz - your laptop resolution.)

    The above configuration will clone your screen. Play with "--right-of / --left-of" option if you want.

  4. If you need this settings while login, add the checks in /etc/X11/Xsession.d/45custom_xrandr-settings (You might need to create one).

    xrandr |grep VGA1 | grep " connected " | if [ $? -eq 0 ]; then xrandr --output LVDS1 --off --output TV1 --off --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal  #Change the way u need ; fi
share|improve this answer

Ubuntu 12.04 remembers hot-plugged monitor settings. But they are only applied when you reopen the System configuration > Displays applet. This is the case for me, at least, and this is definitively a bug.

share|improve this answer

No, there's no way to save configurations on hot-plugged monitors. If you plug in before boot, GNOME should remember the configuration on each boot on a per-device basis (ie, connecting to your monitor at work versus the one at home).

share|improve this answer
Damn, ok. Is there a third party application than can do this? I know Mac OS X does this, and Windows 7 (from what I've tried with the little experience I have with W7). – Oscar Godson Oct 11 '10 at 21:16
The GNOME monitor configuration should save this information for hotplugged monitors, too. It does for me. – RAOF Oct 11 '10 at 23:11
RAOF: weird, since discussion on the ubuntu-devel mailing list earlier this week said it doesn't. – maco Oct 11 '10 at 23:31
the configuration is actually saved in ~/.config/monitors.xml, but it is not applied at startup – Alessandro Cuttin Jan 4 at 9:04

Long story short (that is: do what Nicolas Bernaerts suggests, but I spare you the details): monitors configuration is actually saved in ~/.config/monitors.xml, but it's not applied at startup/login.

The steps to overcome this are:

Log in with the wrong monitors configuration.

Remove current monitor configuration:

cd .config
mv monitors.xml{,.bak}

Use the Displays application to arrange the monitors as you wish (I have one side monitor rotated counterclockwise). arrange your monitors as you wish

Once you press Apply, a new monitors.xml is created.

Now, download and make executable the script and the launcher that force the monitor configuration based on the newly created config file:

$ sudo wget -O /usr/local/sbin/update-monitor-position
$ sudo chmod +x /usr/local/sbin/update-monitor-position
$ sudo wget -O /usr/share/applications/update-monitor-position.desktop
$ sudo chmod +x /usr/share/applications/update-monitor-position.desktop

At this point, the monitors' configuration can be fixed by launching the update monitor position application.

If you want this to be automatic, simply add a startup application, with the following entries:

  • Name: Update Monitors Position
  • Command: update-monitor-position 5
  • Comment: Force monitors position 5 seconds after login

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.