Skip to content

Instantly share code, notes, and snippets.

@j1cs
Created March 27, 2015 01:33
Show Gist options
  • Save j1cs/51ebbb4000425d3183b7 to your computer and use it in GitHub Desktop.
Save j1cs/51ebbb4000425d3183b7 to your computer and use it in GitHub Desktop.
#!/bin/bash
IN="LVDS1"
EXT="VGA1"
if (xrandr | grep "$EXT disconnected"); then
xrandr --output DVI1 --off --output VIRTUAL1 --off --output LVDS1 --mode 1024x768 --pos 0x0 --rotate normal --output VGA1 --off
else
xrandr --output DVI1 --off --output VIRTUAL1 --off --output LVDS1 --mode 1024x768 --pos 0x0 --rotate normal --output VGA1 --mode 1440x900 --pos 1024x0 --rotate normal
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment