diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-01-30 19:30:15 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-01-30 19:30:15 +0000 |
commit | 37a2eea2e21a1a9b82f84567f4bddf3c8886fd5a (patch) | |
tree | 49f8e672d623ddf11ce1257649b6da0b68f7be5e /scripts | |
parent | 103bd28809b94555a810f3f4179bdd004617051f (diff) | |
download | liw-automation-37a2eea2e21a1a9b82f84567f4bddf3c8886fd5a.tar.gz |
Add disp script.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/disp | 25 |
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" |