Advertisement
Guest User

Untitled

a guest
Jan 24th, 2011
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. monitors=`xrandr`
  2.  
  3. echo $monitors | grep "VGA1 connected" > /dev/null
  4. VGA=$?
  5.  
  6. echo $monitors | grep "HDMI1 connected" > /dev/null
  7. HDMI=$?
  8.  
  9. if [ $VGA -eq 0 ]
  10. then
  11. if [ $HDMI -eq 0 ]
  12. then
  13. xrandr --output DP1 --off
  14. xrandr --output VGA1 --auto --output HDMI1 --auto --right-of VGA1
  15. else
  16. xrandr --output HDMI1 --off
  17. xrandr --output VGA1 --auto --output DP1 --auto --left-of VGA1
  18. fi
  19. else
  20. xrandr --output VGA1 --off --output HDMI1 --off
  21. xrandr --output DP1 --auto
  22. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement