diff options
-rwxr-xr-x | autodetect.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/autodetect.sh b/autodetect.sh index 1264e1b..5c3fc5d 100755 --- a/autodetect.sh +++ b/autodetect.sh @@ -54,11 +54,11 @@ if [ -n "$EXT1_NAME" ]; then EXT2_NAME="$(echo "$XRANDR" | grep -v "\($NOTE_NAME\|$EXT1_NAME\)" | detect_connected | head -n 1)" [ -n "$EXT2_NAME" ] && EXT2_STATUS="$(detect_status "$EXT2_NAME")" fi - NOTE_MAX=$(echo "$XRANDR" | grep -A 1 "$NOTE_NAME" | tail -n1 | awk '{ print $1 }') EXT1_MAX=$(echo "$XRANDR" | grep -A 1 "$EXT1_NAME" | tail -n1 | awk '{ print $1 }') EXT2_MAX=$(echo "$XRANDR" | grep -A 1 "$EXT2_NAME" | tail -n1 | awk '{ print $1 }') +## Main "profiles" logic if [ "$COMMAND" = "external" -a "$EXT1_STATUS" = "connected" ]; then xrandr --dpi "$DPI" $(off_except "$EXT1_NAME") --output "$EXT1_NAME" --mode "$EXT1_MAX" @@ -75,6 +75,8 @@ elif [ "$EXT2_STATUS" = "disconnected" -a "$NOTE_STATUS" = "connected" -a "$EXT1 handle_non_exist_mode "$EXT1_NAME" "$NOTE_NAME" "$EXT1_MAX" "$NOTE_MAX" elif [ "$EXT2_STATUS" = "connected" -a "$NOTE_STATUS" = "connected" -a "$EXT1_STATUS" = "connected" ]; then + # This isn't one command, because there is some weird error in xrandr. + # That is the only way that this thing works. xrandr --dpi "$DPI" $(off_except "$NOTE_NAME" "$EXT1_NAME" "$EXT2_NAME") xrandr --dpi "$DPI" --output "$NOTE_NAME" --mode "$NOTE_MAX" xrandr --dpi "$DPI" --output "$EXT1_NAME" --mode "$EXT1_MAX" --left-of "$NOTE_NAME" |