I'm using a script like this to set the gamma values of my laptop screen and external monitor:
#!/bin/bash export DISPLAY=:0 export XAUTHORITY=/home/peat/.Xauthority xrandr --output LVDS1 --gamma 0.7:0.7:0.4 xrandr --output DP1--gamma 0.8:0.8:0.8
Running it on startup or manually from the terminal works perfectly. However, when removing or plugging in a display, the gamma gets reset for all screens. I try to solve it by creating this udev rule in /etc/udev/rules.d/999_setMonitorGamma.rules:
SUBSYSTEM=="drm", ACTION=="change", RUN+="/home/peat/scripts/setMonitorGamma.sh"
At what point it almost works. I can see the screen flash with the correct gamma for a brief instant, then the incorrect gamma gets applied again. It seems like there's some sort of autodetection run after the udev rules get processed, that resets the display settings. How can I work around this?
Running Linux Mint 16, based on Ubuntu 13.10