From 37a2eea2e21a1a9b82f84567f4bddf3c8886fd5a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 30 Jan 2011 19:30:15 +0000 Subject: Add disp script. --- scripts/disp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/disp 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" -- cgit v1.2.1