Skip to content

Instantly share code, notes, and snippets.

@lazyfrosch
Created November 2, 2012 13:13
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 lazyfrosch/4001310 to your computer and use it in GitHub Desktop.
Save lazyfrosch/4001310 to your computer and use it in GitHub Desktop.
auto display
_auto.sh
#!/bin/bash
info=$(nv-control-dpy --probe-dpys)
if [[ "$info" == *"BenQ FP767-12"* ]]; then
~/.screenlayout/home.sh
elif [[ "$info" == *"Idek Iiyama PLE2208HDS"* ]]; then
~/.screenlayout/work.sh
else
~/.screenlayout/mobile.sh
fi
#----------
home.sh
#!/bin/sh
xrandr --output VGA-0 --mode 1280x1024 --pos 0x0 --rotate normal --output LVDS-0 --mode 1920x1080 --pos 1280x0 --rotate normal --output HDMI-0 --off --output DP-3 --off --output DP-2 --off --output DP-1 --off --output DP-0 --off
#----------
mobile.sh
#!/bin/sh
xrandr --output VGA-0 --off --output LVDS-0 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-0 --off --output DP-3 --off --output DP-2 --off --output DP-1 --off --output DP-0 --off
#----------
work.sh
#!/bin/sh
xrandr --output VGA-0 --mode 1920x1080 --pos 1920x0 --rotate normal --output LVDS-0 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-0 --off --output DP-3 --off --output DP-2 --off --output DP-1 --off --output DP-0 --off
#----------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment