Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Unified Diff: run_monitor_reconfigure

Issue 3647002: monitor_reconfig: Add script to run for external displays. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/monitor_reconfig.git
Patch Set: apply review feedback Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698