Skip to content

Instantly share code, notes, and snippets.

@orymate
Created June 26, 2013 09:14
Show Gist options
  • Save orymate/5865958 to your computer and use it in GitHub Desktop.
Save orymate/5865958 to your computer and use it in GitHub Desktop.
Set dual-screen resolutions
#!/bin/bash
xrandr --output LVDS1 --mode 1360x768 --primary
if xrandr | grep 'HDMI.* connected'
then
xrandr --output HDMI1 --mode 1280x1024 --left-of LVDS1
xrandr --output VGA1 --off
elif xrandr | grep 'VGA.* connected'
then
xrandr --output HDMI1 --off
xrandr --output VGA1 --mode 1280x1024 --left-of LVDS1
else
xrandr --output HDMI1 --off
xrandr --output VGA1 --off
fi
xrandr --output LVDS1 --mode 1360x768 --primary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment