Max: Add temp padding to time padding.

This commit is contained in:
Dmitry Voronin 2024-12-19 06:36:39 +03:00
parent 1aac1a859b
commit fdf80f6def

View file

@ -50,6 +50,7 @@ in
]; ];
script = '' script = ''
old=0 old=0
oldtemp=0
smooth=0 smooth=0
while true; do while true; do
temp=$(cat /sys/devices/pci0000\:00/0000\:00\:18.3/hwmon/*/temp1_input) temp=$(cat /sys/devices/pci0000\:00/0000\:00\:18.3/hwmon/*/temp1_input)
@ -61,8 +62,8 @@ in
then value=128 then value=128
elif [ $temp -gt 60000 ] elif [ $temp -gt 60000 ]
then value=92 then value=92
# elif [ $temp -gt 50000 ] elif [ $temp -gt 55000 ]
# then value=69 then value=69
elif [ $temp -gt 45000 ] elif [ $temp -gt 45000 ]
then value=46 then value=46
elif [ $temp -gt 40000 ] elif [ $temp -gt 40000 ]
@ -71,11 +72,14 @@ in
fi fi
if [[ $old != $value ]]; then if [[ $old != $value ]]; then
# 30 = 60s smooth. # 30 = 60s smooth. -5 degrees smooth.
if [[ $value -lt $old ]] && [[ $smooth -lt 30 ]]; then if [[ $value -lt $old ]] && [[ $smooth -lt 30 ]]; then
if [[ $temp -lt $((oldtemp - 5000)) ]]; then
smooth=$((smooth+1)) smooth=$((smooth+1))
fi
else else
old=$value old=$value
oldtemp=$temp
smooth=0 smooth=0
wm2fc $value wm2fc $value
fi fi