From e7f25fe1cc6ef6cb5d1ee31a33cb7f53324287d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Wed, 4 Mar 2015 22:31:48 +0100 Subject: Add support for mirror mode --- autodetect.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/autodetect.sh b/autodetect.sh index 12fbcaa..bf69c79 100755 --- a/autodetect.sh +++ b/autodetect.sh @@ -69,6 +69,16 @@ if [ "$COMMAND" = "external" -a "$EXT1_STATUS" = "connected" ]; then elif [ "$COMMAND" = "external2" -a "$EXT2_STATUS" = "connected" ]; then xrandr --dpi "$DPI" $(off_except "$EXT2_NAME") --output "$EXT2_NAME" --mode "$EXT2_MAX" +elif [ "$COMMAND" = "mirror" -a "$NOTE_STATUS" = "connected" -a "$EXT1_STATUS" = "connected" ]; then + if [ "$(echo "$NOTE_MAX" | cut -dx -f1)" -le "$(echo "$EXT1_MAX" | cut -dx -f1)" ]; then + MUTUAL_RESOLUTION="$NOTE_MAX" + else + MUTUAL_RESOLUTION="$EXT1_MAX" + fi + xrandr --dpi "$DPI" $(off_except "$NOTE_NAME" "$EXT1_NAME") \ + --output "$NOTE_NAME" --mode "$MUTUAL_RESOLUTION" \ + --output "$EXT1_NAME" --mode "$MUTUAL_RESOLUTION" --same-as "$NOTE_NAME" + elif [ "$COMMAND" = "2external" -a "$EXT1_STATUS" = "connected" -a "$EXT2_STATUS" = "connected" ]; then handle_non_exist_mode "$EXT2_NAME" "$EXT1_NAME" "$EXT2_MAX" "$EXT1_MAX" -- cgit v1.2.3