Created
October 31, 2016 19:17
-
-
Save amishurov/77cf780ff4f0958c742a7f9bef1be61b to your computer and use it in GitHub Desktop.
hotplug second monitor
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
crude version of https://github.com/codingtony/udev-monitor-hotplug/blob/master/usr/local/bin/monitor-hotplug.sh | |
cat /usr/local/bin/hotplug_monitor.sh | |
#!/bin/bash | |
export XAUTHORITY=/home/USER/.Xauthority | |
export DISPLAY=:0.0 | |
if [ $(cat /sys/class/drm/card0-VGA-1/status) == "connected" ]; then | |
/usr/bin/xrandr -d :0 --output VGA1 --right-of LVDS1 --auto | |
else | |
/usr/bin/xrandr -d :0 --output LVDS1 --auto | |
fi | |
cat /etc/udev/rules.d/99-monitor.rules | |
ACTION=="change", SUBSYSTEM=="drm", ENV{HOTPLUG}=="1", RUN+="/usr/local/bin/hotplug_monitor.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment