3 # The idea for this was taken from
4 # https://gist.github.com/menski/2891431 and modified slightly
6 # wait for the dock state to change
8 # use the xdm xauthority
9 XAUTHORITY="$(ls -1 /var/lib/xdm/authdir/authfiles/*|head -n1)"
14 DOCKED=$(cat /sys/devices/platform/dock.2/docked)
17 #undocked event - lets remove all connected outputs apart from LVDS
18 for output in $(/usr/bin/xrandr | grep " connected" | grep -v LVDS | awk '{print $1}')
20 /usr/bin/xrandr --output $output --off
22 for output in $(/usr/bin/xrandr | grep " connected" | grep LVDS | awk '{print $1}')
24 /usr/bin/xrandr --output $output --auto
28 # docked event; enable all of the screens
29 /usr/bin/xrandr --auto