Hi,
Tried following the guide for another Netbook I have which I'm running openbox on and I decided I'd like the same behaviour for.
It didn't work off the bat; it initially refused to run my script and the script didn't do what I really wanted (i.e. only one monitor at a time, using the VGA one if connected over the internal one.)
/etc/udev/rules.d/80-vga.rules
Code:
ACTION=="change", SUBSYSTEM=="drm", RUN+="/etc/udev/scripts/hotplug.sh"
/etc/udev/scripts/hotplug.sh
Code:
#!/bin/bash -
set -o nounset
read STATUS < /sys/class/drm/card0-VGA-1/status
export DISPLAY=:0
export XAUTHORITY=/home/mikey/.Xauthority
if [ "$STATUS" = "connected" ]; then
/usr/bin/xrandr --output LVDS1 --off --output VGA1 --auto --screen 0
else
/usr/bin/xrandr --output VGA1 --off --output LVDS1 --auto --screen 0
fi
For some reason the HOTPLUG selection from the Udev rule in the linked page didn't work; I'm not sure what exactly it was doing, so I'm not sure now if it's being too selective and running for other events beyond the monitor being plugged and unplugged. Guess it wont do too much harm.