summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-01-30 19:30:15 +0000
committerLars Wirzenius <liw@liw.fi>2011-01-30 19:30:15 +0000
commit37a2eea2e21a1a9b82f84567f4bddf3c8886fd5a (patch)
tree49f8e672d623ddf11ce1257649b6da0b68f7be5e
parent103bd28809b94555a810f3f4179bdd004617051f (diff)
downloadliw-automation-37a2eea2e21a1a9b82f84567f4bddf3c8886fd5a.tar.gz
Add disp script.
-rwxr-xr-xscripts/disp25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/disp b/scripts/disp
new file mode 100755
index 0000000..ed33a58
--- /dev/null
+++ b/scripts/disp
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+temp="$(mktemp)"
+xrandr -q > "$temp"
+awk '
+ BEGIN {
+ printf "xrandr "
+ }
+ $2 == "connected" {
+ what = $1
+ res = ""
+ }
+ /^ [0-9]/ && what != "" {
+ printf "--output %s --mode %s ", what, $1
+ if (what == "LVDS1") printf "--same-as VGA1 "
+ what =""
+ }
+ END {
+ printf "\n"
+ }
+' "$temp" | sh
+
+rm -f "$temp"