Skip to content

Instantly share code, notes, and snippets.

@bremme
Created July 7, 2020 19:21
Show Gist options
  • Save bremme/c2fb0b9378d3dc05404aa8840b421a40 to your computer and use it in GitHub Desktop.
Save bremme/c2fb0b9378d3dc05404aa8840b421a40 to your computer and use it in GitHub Desktop.
Switch between triple monitors and single monitor
#!/usr/bin/env bash
if [[ $1 == "on" ]]; then
# Turn on all three monitors and make 2nd primary
xrandr --output DP-2 --auto --primary
xrandr --output DP-0 --auto --left-of DP-2
xrandr --output DP-4 --auto --right-of DP-2
elif [[ $1 == "off" ]]; then
# Turn all three monitors off and make 3rd primary
xrandr --output DP-0 --off
xrandr --output DP-2 --off
xrandr --output DP-4 --auto --primary
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment