summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2015-03-04 22:31:48 +0100
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2015-03-04 22:31:48 +0100
commite7f25fe1cc6ef6cb5d1ee31a33cb7f53324287d2 (patch)
treedc4ac7eae0ef5e280071873a7ab1ef7786a4251d
parentAdd 2 more commands (diff)
downloaddisplay_autoset-e7f25fe1cc6ef6cb5d1ee31a33cb7f53324287d2.tar.xz
Add support for mirror mode
-rwxr-xr-xautodetect.sh10
1 files changed, 10 insertions, 0 deletions
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"