diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2015-02-22 22:41:48 +0100 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2015-02-22 22:41:48 +0100 |
commit | 8529ff03d3268a815d2f28593ae92ef97e5e7176 (patch) | |
tree | 654bc998d3c6c49f2ca8f645eb57d852c56c90b1 | |
parent | Turn off debug (diff) | |
download | display_autoset-8529ff03d3268a815d2f28593ae92ef97e5e7176.tar.xz |
Add some comments
-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" |