Last active
May 31, 2016 08:59
-
-
Save runjak/ffe16716765e472e19970b500cfa251d to your computer and use it in GitHub Desktop.
Wrapper script for xrandr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
intern=eDP1 | |
extern=$(xrandr|grep " connected"|sed "s/ .*//g"|grep -v eDP1) | |
case $1 in | |
above) | |
xrandr --output $intern --auto --output $extern --auto --above $intern | |
;; | |
below) | |
xrandr --output $intern --auto --output $extern --auto --below $intern | |
;; | |
left) | |
xrandr --output $intern --auto --output $extern --auto --left-of $intern | |
;; | |
right) | |
xrandr --output $intern --auto --output $extern --auto --right-of $intern | |
;; | |
extern) | |
xrandr --output $extern --auto --output $intern --off | |
;; | |
mirror) | |
xrandr --output $intern --auto --output $extern --auto --same-as $intern | |
;; | |
off) | |
xrandr --output $intern --auto --output $extern --off | |
;; | |
*) | |
echo "Usage: $0 [above|below|left|right|extern|mirror|off]" | |
echo "intern is: '$intern', extern is: '$extern'." | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment