summaryrefslogtreecommitdiffstats
diff options
context:
space:
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"