Created
July 14, 2014 15:49
-
-
Save Ajnasz/c4faea76a28758c7f0b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# IN=LVDS-0; | |
IN=eDP1 | |
LASTDISPLAY=$IN | |
setoff() { | |
for display in `xrandr | awk '/ disconnected/ {print $1}'`; do | |
echo "maybe disabling $display"; | |
xrandr --output $display --off | |
done; | |
} | |
seton() { | |
CMD="xrandr --output $IN --auto --primary"; | |
for display in `xrandr | awk '/ connected/ {print $1}'`; do | |
if [ "$display" != "$IN" ]; then | |
CMD="$CMD --output $display --auto --right-of $LASTDISPLAY"; | |
LASTDISPLAY=$display | |
fi | |
done; | |
echo $CMD | |
$CMD | |
} | |
setoff; | |
# seton; | |
xrandr --output eDP1 --auto --primary --output DP1 --auto --right-of eDP1 --output VGA1 --auto --right-of DP1 | |
exit $?; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment