I am trying to setup my system so that when I put my laptop onto the docking station if automatically enables my external monitor ( which is plugged into the docking station), the way that I am trying to do this is to add these lines to /etc/acpi/power.sh
Code: Select all
if xrandr -q | grep -q "TMDS-1 connected"; then
echo "enabling external display";
exec xrandr --output LVDS --mode 1280x800 --output TMDS-1 --mode 1680x1050 --pos 0x0
else
echo "disabling external display";
exec xrandr --output LVDS --mode 1280x800 --pos 0x0 --output TMDS-1 --off
fi
If I put those lines into a script and run the script manually, it works fine, but if I put those lines into /etc/acpi/power.sh it doesn't do anything at all.
I have checked that that /etc/acpi/power.sh actually gets run when power is plugged in or removed by adding this line to the file:
Code: Select all
echo "test" >> /home/timothy/Desktop/test.txt
So has anyone got any idea on why this doesn't work?
Or how I could do it that does work?
thanks
Tim