dotfiles

personal dotfiles
git clone anongit@rnpnr.xyz:dotfiles.git
Log | Files | Refs | Feed | Submodules

sct-ramp (422B)


      1 #!/bin/sh
      2 
      3 # slowly ramps screen temperature
      4 
      5 SS=100 # Step Size
      6 SP=10  # Step Period [s]
      7 
      8 usage()
      9 {
     10 	printf "usage: %s temperature\n" "$*" >&2
     11 	exit 1
     12 }
     13 
     14 [ $# -ne 1 ] && usage "$(basename "$0")"
     15 [ "$1" -eq 0 ] && set -- 6500
     16 
     17 temp=$(sct | cut -d ' ' -f 5)
     18 [ "$temp" -gt "$1" ] && SS="-$SS"
     19 
     20 for i in $(seq "$temp" $SS "$1"); do
     21 	sct "$i"
     22 	sleep $SP
     23 done
     24 # cleanup any remainder
     25 sct "$1"
     26 
     27 notify "sct-ramp: $1" "complete"