Created
May 4, 2017 15:58
-
-
Save rosshadden/080cb46d8e504d024de7382144de668c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
numDisplays=$(xrandr --current | grep '\bconnected' | wc -l) | |
outputs="--output eDP1 --primary --mode 2880x1620 --pos 2880x0 --dpi 96 --scale 1x1" | |
xrandr --output HDMI1 --off | |
xrandr --output DP2 --off | |
if xrandr | grep "HDMI1 connected"; then | |
outputs+=" --output HDMI1 --auto --mode 1920x1080 --pos 0x0 --right-of eDP1 --scale 1.5x1.5" | |
fi | |
if xrandr | grep "DP2 connected"; then | |
outputs+=" --output DP2 --auto --mode 1920x1080 --pos 5760x0 --left-of eDP1 --scale 1.5x1.5" | |
fi | |
xrandr $outputs | |
if xrandr | grep "HDMI1 connected"; then | |
xrandr --output HDMI1 --pos 0x0 | |
xrandr --output eDP1 --pos 2880x0 | |
if xrandr | grep "DP2 connected"; then | |
xrandr --output DP2 --pos 5760x0 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment