Commit: 21a6ee2b8781283c9412db4c96bad06027857abe Parent: faa15999ecbcb6cdc69667cff14e694aaaef46bd Author: Randy Palamar Date: Wed, 5 Apr 2023 07:35:23 -0600 add a "temporary" script to ramp the display temperature eventually I would like this to be a daemon that runs at specific times of day and doesn't miss times when the system is sleeping. Diffstat:
A | bin/sct-ramp | | | 27 | +++++++++++++++++++++++++++ |
1 file changed, 27 insertions(+), 0 deletions(-)
diff --git a/bin/sct-ramp b/bin/sct-ramp @@ -0,0 +1,27 @@ +#!/bin/sh + +# slowly ramps screen temperature + +SS=100 # Step Size +SP=10 # Step Period [s] + +usage() +{ + printf "usage: %s temperature\n" "$*" >&2 + exit 1 +} + +[ $# -ne 1 ] && usage "$(basename "$0")" +[ "$1" -eq 0 ] && set -- 6500 + +temp=$(sct | cut -d ' ' -f 5) +[ "$temp" -gt "$1" ] && SS="-$SS" + +for i in $(seq "$temp" $SS "$1"); do + sct "$i" + sleep $SP +done +# cleanup any remainder +sct "$1" + +notify "sct-ramp: $1" "complete"