Решение Фортрана.
Из домашнего каталога Linux создайте подкаталог /mygamma/
Каталог mygamma содержит шесть файлов: 2 сценария программы на языке фортранс : contrastdown.f90 и contrastup.f90 , их исполняемые файлы gammadown и gammaup и файл shebang xgammasave который сохраняет текущее значение xgamma в текстовый файл xgammaval.txt
Файл xgammasave выглядит так:
#!/bin/bash
xgamma |& tee ~/mygamma/xgammaval.txt
Файл contrastup.f90 выглядит следующим образом:
program contrastup
 character(len=20):: string,string2,string3 ! variable type declarations
 real(kind(1.0)) :: x
 call system('/home/my_name/mygamma/xgammasave') ! write the xgamma value to a file
 open(unit=2,file='/home/my_name/mygamma/xgammaval.txt',action='read',status='old')
 read(unit=2,fmt=*)string,string2,string3 ! read the file
 read(string3,*)x            ! make a real from a string
 x=x/1.2                     ! change the contrast
  if (x .le. 0.1) goto 10    ! xgamma value can not be less than 0.1
 write(string,*)x            ! make a string from a real
 string2='xgamma -gamma ' // trim(string) ! concatenate 2 strings
 call system(string2)        ! pass the string to the command line
10 close(unit=2)
end program contrastup
и contrastdown.f90
program contrastdown
 character(len=20):: string,string2,string3 ! variable type declarations
 real(kind(1.0)) :: x
 call system('/home/my_name/mygamma/xgammasave')  ! write xgamma value to a file
 open(unit=2,file='/home/my_name/mygamma/xgammaval.txt',action='read',status='old')
 read(unit=2,fmt=*)string,string2,string3 ! read the record
 read(string3,*)x             ! make a real from a string
 x=x*1.2                      ! change the contrast
  if (x .ge. 10.0) goto 10   ! xgamma value can not be greater than 10.0
 write(string,*)x             ! make a string from a real
 string2='xgamma -gamma ' // trim(string) ! concatenate two strings
 call system(string2)         ! pass the string to the command line
10 close(unit=2)
end program contrastdown
Сделайте исполняемые файлы Fortran gammaup и gammadown: 
   
~/mygamma $ gfortran contrastup.f90 -o gammaup  
~/mygamma $ gfortran contrastdown.f90 -o gammadown 
В зависимости от разновидности Linux, в Центре управления> Сочетания клавиш, в разделе «Пользовательские сочетания клавиш» выберите «Добавить», в поле имени введите имя сочетания клавиш «Повышение гаммы» и в командной строке введите /home/my_name/mygamma/gammaup и аналогично для клавиши «нижний контраст» с командой /home/my_name/mygamma/gammadown
На моем ноутбуке Fn F6 и Fn F5 - клавиши увеличения / уменьшения яркости по умолчанию, теперь над ними вновь определены клавиши Shift F6 и Shift F5 - клавиши контрастности вверх / вниз. Винтажные черно-белые фильмы теперь красиво смотрятся на глянцевом экране :)
Может ли решение Fortran быть Code Golf для меньшего количества линий.