Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. export MONITOR2=/sys/class/drm/card0-HDMI-A-1/status
  4.  
  5. while inotifywait -e modify,create,delete,open,close,close_write,access $MONITOR2;
  6.  
  7. dmode="$(cat $MONITOR2)"
  8.  
  9. do
  10. if [ "${dmode}" = disconnected ]; then
  11. /usr/bin/xrandr --auto
  12. echo "${dmode}"
  13. else [ "${dmode}" = connected ];
  14. /usr/bin/xrandr --output HDMI1 --mode 1920x1080 --primary --auto
  15. xrandr --output LVDS1 --off
  16. echo "${dmode}"
  17. fi
  18. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement