Add support for monitor hotplug detection.

Add a udev rule file and script to run monitor_reconfigure instead
of requiring the user to hit Ctrl-Fullscreen (Ctrl-F4, was Ctrl-Alt-M)
to enter/exit Presentation Mode.

BUG=chromium-os:3107
TEST=Plug in/out external monitor and wait a few seconds of reconfiguration.

Change-Id: I222998d64e4b94cd648085fdd70ad5daad48c7af

Review URL: http://codereview.chromium.org/5637002
diff --git a/99-monitor-hotplug.rules b/99-monitor-hotplug.rules
new file mode 100644
index 0000000..77cefa7
--- /dev/null
+++ b/99-monitor-hotplug.rules
@@ -0,0 +1,2 @@
+# Reconfigure display output when the external monitor is [un]plugged.
+ACTION=="change", SUBSYSTEM=="drm", HOTPLUG=="1", RUN+="display-configure.sh"
diff --git a/display-configure.sh b/display-configure.sh
new file mode 100644
index 0000000..fc3b50a
--- /dev/null
+++ b/display-configure.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+export DISPLAY=:0
+export XAUTHORITY=/home/chronos/.Xauthority
+/usr/bin/monitor_reconfigure