Skip to content

Instantly share code, notes, and snippets.

@Tafhim
Last active November 27, 2016 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tafhim/ee073f6cd978a32df86da5e408b4181e to your computer and use it in GitHub Desktop.
Save Tafhim/ee073f6cd978a32df86da5e408b4181e to your computer and use it in GitHub Desktop.
You can link this to your /usr/local/bin and call it like "reset_display left", "reset_display right" or simply "reset_display"
#!/bin/bash
left_display="eDP1"
right_display="HDMI2"
if [ $1 = "left" ]
then
xrandr --output $left_display --mode 1366x768 --output $right_display --off
elif [ $1 = "right" ]
then
xrandr --output $left_display --off --output $right_display --mode 1920x1080
elif [ $1 = "both" ]
then
xrandr --output $left_display --mode 1366x768 --output $right_display --mode 1920x1080 --right-of $left_display
else
xrandr --output $left_display --mode 1366x768 --output $right_display --mode 1920x1080 --same-as $left_display
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment