Skip to content

Instantly share code, notes, and snippets.

@agriffis
Created April 1, 2012 20:25
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 agriffis/2278440 to your computer and use it in GitHub Desktop.
Save agriffis/2278440 to your computer and use it in GitHub Desktop.
sitdown (or standup) with nvidia proprietary driver
#!/bin/bash
if glxinfo | grep -q 'NVIDIA Corporation'; then
case /$0 in
*/sitdown) xrandr -s 1 ;;
*/standup) xrandr -s 0 ;;
esac
else
hdmi=HDMI-1
dvi=DVI-D-1
case /$0 in
*/sitdown) xrandr --output $hdmi --auto ; xrandr --output $dvi --off ;;
*/standup) xrandr --output $dvi --auto ; xrandr --output $hdmi --off ;;
esac
fi
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "1"
Option "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-1: NULL; DFP-0: NULL, DFP-1: nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment