iiyama ProLite E2783QSU Ubuntu gamma xrandr startup suspend resume persist

Settings

Monitor:

  • Brightness: 45
  • Luminace: 80
  • Color (RGB):  70:75:100

Ubuntu:

  • Find correct port:
    • xrandr --query | grep ' connected'
    • In my case it's "DP-1-2"
  • xrandr --output DP-1-2 --gamma 0.72:0.70:0.60
    • (new setting: 0.83:0.87:0.69)

Persist

Update: the easiest way to work in every case (startup, suspend, ...) is to put it into a cronjob executed every minute:

  • crontab -e
    • # Xrandr for Iiyama Gamma
      * * * * *       DISPLAY=:0 XAUTHORITY=/home/klemens/.Xauthority xrandr --output DP-1-2 --gamma 0.72:0.70:0.60

 


Old Stuff

Startup

Create script

  • cd ~
  • mkdir bin
  • vi bin/iiyama_gamma.sh
    • #!/bin/sh
      
      # sleep, otherwise gamma will be set, but shortly overrules by something else
      sleep 1
      xrandr --output DP-1-1 --gamma 0.72:0.70:0.60
      
  • chmod 755 bin/iiyama_gamma.sh

Add to startup programs

  • Launch Ubuntu/Gnome "Startup Programs" or "gnome-session-properties" from the command line
  • Click "Add"
    • Name: Monitor gamma
    • Command: /home/klemens/bin/iiyama_gamma.sh

Note: .xprofile did not work, as it is called to early in the process. The correct settings appear for a short time, but are lost shortly after.

Reapply after suspend

  • sudo vi /lib/systemd/system-sleep/iiyama_gamma
    • #!/bin/sh
      
      case $1/$2 in
        post/*)
          # Place your post suspend (resume) commands here, or `exit 0` if no post suspend action required
          export DISPLAY=:0
          export XAUTHORITY=/home/klemens/.Xauthority
          xrandr --output DP-1-1 --gamma 0.72:0.70:0.60
      
          # Debugging stuff
          #echo "Waking up from $2..."    
          #sleep 1
          #date >> /tmp/resume.txt
          #echo $DISPLAY >> /tmp/resume.txt
          #echo $XAUTHORITY >> /tmp/resume.txt
          ;;
      esac
  • chmod 755 /lib/systemd/system-sleep/iiyama_gamma