diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2015-02-22 15:57:54 +0100 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2015-02-22 15:57:54 +0100 |
commit | 7cd662943d37c3adaf0eeb67b14fa5dc2e293cb9 (patch) | |
tree | 34db8fdd37e4982a9872ab80197d39d18fe74fc3 /autodetect.sh | |
parent | Change names for new kernel and intel x-org driver (diff) | |
download | display_autoset-7cd662943d37c3adaf0eeb67b14fa5dc2e293cb9.tar.xz |
Rewrite script to /bin/sh instead of /bin/bash
Diffstat (limited to 'autodetect.sh')
-rwxr-xr-x | autodetect.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/autodetect.sh b/autodetect.sh index 2a39980..97aacf6 100755 --- a/autodetect.sh +++ b/autodetect.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -x #Set this values on new system! ########################################## @@ -21,26 +21,26 @@ EXT1_MAX=$(echo "$XRANDR_OUT" | grep -A 1 $EXT1_NAME | tail -n1 | awk '{ print $ COMMAND="$1" -function handle_non_exist_mode { +handle_non_exist_mode() { xrandr --dpi 96 --output $2 --mode $4 --output $1 --mode $3 --left-of $2 } -if [[ ("$COMMAND" == "external") && ("$EXT2_STATUS" == "connected") ]]; then +if [ "$COMMAND" = "external" -a "$EXT2_STATUS" = "connected" ]; then xrandr --dpi 96 --output "$EXT2_NAME" --mode "$EXT2_MAX" --output "$NOTE_NAME" --off -elif [[ ("$COMMAND" == "external") && ("$EXT1_STATUS" == "connected") ]]; then +elif [ "$COMMAND" = "external" -a "$EXT1_STATUS" = "connected" ]; then xrandr --dpi 96 --output "$EXT1_NAME" --mode "$EXT1_MAX" --output "$NOTE_NAME" --off -elif [[ ("$EXT2_STATUS" == "connected") && ("$NOTE_STATUS" == "connected") && ("$EXT1_STATUS" == "disconnected") ]]; then +elif [ "$EXT2_STATUS" = "connected" -a "$NOTE_STATUS" = "connected" -a "$EXT1_STATUS" = "disconnected" ]; then handle_non_exist_mode "$EXT2_NAME" "$NOTE_NAME" "$EXT2_MAX" "$NOTE_MAX" -elif [[ ("$EXT2_STATUS" == "disconnected") && ("$NOTE_STATUS" == "connected") && ("$EXT1_STATUS" == "connected") ]]; then +elif [ "$EXT2_STATUS" = "disconnected" -a "$NOTE_STATUS" = "connected" -a "$EXT1_STATUS" = "connected" ]; then handle_non_exist_mode "$EXT1_NAME" "$NOTE_NAME" "$EXT1_MAX" "$NOTE_MAX" -elif [[ ("$EXT2_STATUS" == "connected") && ("$NOTE_STATUS" == "connected") && ("$EXT1_STATUS" == "connected") ]]; then - xrandr --dpi 96 --output "$NOTE_NAME" --mode "$NOTE_MAX" --output "$EXT2_NAME" --mode "$EXT2_MAX" --left-of "$NOTE_NAME" --output "$EXT1_NAME" --mode "$EXT1_MAX" --left-of "$EXT2_NAME" +elif [ "$EXT2_STATUS" = "connected" -a "$NOTE_STATUS" = "connected" -a "$EXT1_STATUS" = "connected" ]; then + xrandr --dpi 96 --output "$NOTE_NAME" --mode "$NOTE_MAX" --output "$EXT1_NAME" --mode "$EXT1_MAX" --left-of "$NOTE_NAME" --output "$EXT2_NAME" --mode "$EXT2_MAX" --left-of "$EXT1_NAME" -elif [[ ("$EXT2_STATUS" == "disconnected") && ("$NOTE_STATUS" == "connected") && ("$EXT1_STATUS" == "disconnected") ]]; then +elif [ "$EXT2_STATUS" = "disconnected" -a "$NOTE_STATUS" = "connected" -a "$EXT1_STATUS" = "disconnected" ]; then ~/bin/dnote.sh fi |