Created
May 28, 2014 23:51
-
-
Save lanrat/835178bb086d17664a8d to your computer and use it in GitHub Desktop.
script to update xrandr when monitor configuration changes
This file contains hidden or 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
#!/bin/sh | |
CONNECTED_OUTPUTS=$(xrandr -q | grep "\Wconnected" | cut -d ' ' -f1) | |
DISCONNECTED_OUTPUTS=$(xrandr -q | grep "\Wdisconnected" | cut -d ' ' -f1) | |
disable() | |
{ | |
for output in $DISCONNECTED_OUTPUTS; | |
do | |
xrandr --output $output --off | |
done | |
} | |
enable_auto() | |
{ | |
prev='' | |
for output in $CONNECTED_OUTPUTS; | |
do | |
xrandr --output $output --auto $prev | |
prev="--right-of $output" | |
done | |
} | |
enable_eve() | |
{ | |
xrandr \ | |
--output LVDS1 --preferred --pos 277x1080 \ | |
--output HDMI1 --preferred --pos 0x0 | |
} | |
#diable old | |
disable | |
#check for eve config | |
EVE_EEID='00ffffffffffff005a6325cb01010101' | |
v=$(xrandr -q --verbose | grep ${EVE_EEID}) | |
if [ $? -eq 0 ]; | |
then | |
enable_eve | |
else | |
enable_auto | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment