scripts

Scripts
git clone git://git.wimdupont.com/scripts.git
Log | Files | Refs | LICENSE

ugamma (485B)


      1 #!/bin/bash
      2 
      3 #requires calc and xorg-xgamma
      4 
      5 while getopts "v:" arg; do
      6  case $arg in
      7 	v) value=(${OPTARG});;
      8  esac
      9 done
     10 
     11 shift $((OPTIND-1))
     12 
     13 if [ -z "${value}" ]; then
     14 	echo "No value argument (-v) given, resetting to 1.0 instead."
     15 	xgamma -gamma 1
     16 else
     17 	readonly GAMMA_VALUE=$(xgamma 2>&1 | awk '{print $3}' | sed "s/,//") 
     18 	xgamma -gamma $(calc "${GAMMA_VALUE}" + "${value}" | sed "s/\t//g")
     19 fi
     20 
     21 dunstify -h string:x-dunst-stack-tag:gamma "Gamma" "$(xgamma 2>&1 | sed 's/-> //g')"