Index: run_monitor_reconfigure |
diff --git a/run_monitor_reconfigure b/run_monitor_reconfigure |
new file mode 100755 |
index 0000000000000000000000000000000000000000..33a4438d8e2f1dbcf812c7c6b84c584029f4574e |
--- /dev/null |
+++ b/run_monitor_reconfigure |
@@ -0,0 +1,20 @@ |
+#!/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. |
+ |
+# If there's an external display connected, runs the monitor_reconfigure |
+# command to choose a screen resolution. |
+ |
+XRANDR=/usr/bin/xrandr |
+MONITOR_RECONFIGURE=/usr/bin/monitor_reconfigure |
+ |
+# Always exit with 0 |
+trap "exit 0" EXIT |
+set -e |
+ |
+NUM_OUTPUTS=$($XRANDR | grep -c ' connected') |
+if [ "$NUM_OUTPUTS" -gt 1 ]; then |
+ $MONITOR_RECONFIGURE |
+fi |