Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- export MONITOR2=/sys/class/drm/card0-HDMI-A-1/status
- while inotifywait -e modify,create,delete,open,close,close_write,access $MONITOR2;
- dmode="$(cat $MONITOR2)"
- do
- if [ "${dmode}" = disconnected ]; then
- /usr/bin/xrandr --auto
- echo "${dmode}"
- else [ "${dmode}" = connected ];
- /usr/bin/xrandr --output HDMI1 --mode 1920x1080 --primary --auto
- xrandr --output LVDS1 --off
- echo "${dmode}"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement