Skip to content

Instantly share code, notes, and snippets.

@GuillaumeRochat
Created March 18, 2019 18:44
Show Gist options
  • Save GuillaumeRochat/657df3f2f96ef9b183b145171df6c11b to your computer and use it in GitHub Desktop.
Save GuillaumeRochat/657df3f2f96ef9b183b145171df6c11b to your computer and use it in GitHub Desktop.
#!/bin/zsh
intern=eDP1
dual1=HDMI1
dual2=DP1
if xrandr | grep "$dual1 connected"; then
xrandr --output "$intern" --auto --primary --output "$dual1" --right-of "$intern" --auto --output "$dual2" --right-of "$dual1" --auto
else
xrandr --output "$dual1" --off --output "$dual2" --off --output "$intern" --auto
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment