Max: Add temp down padding.

This commit is contained in:
Dmitry Voronin 2024-12-17 19:38:24 +03:00
parent 165dc8ed06
commit 9045365f23
3 changed files with 25 additions and 10 deletions

View file

@ -187,16 +187,20 @@ in {
signal = 7; signal = 7;
}; };
"custom/taghw1" = { "custom/taghw1" = {
exec = "echo "; exec = "echo ";
tooltip = false;
}; };
"custom/taghw2" = { "custom/taghw2" = {
exec = "echo "; exec = "echo ";
tooltip = false;
}; };
"custom/tagbt1" = { "custom/tagbt1" = {
exec = "test -e /sys/class/power_supply/BAT*/capacity && echo "; exec = "test -e /sys/class/power_supply/BAT*/capacity && echo ";
tooltip = false;
}; };
"custom/tagbt2" = { "custom/tagbt2" = {
exec = "test -e /sys/class/power_supply/BAT*/capacity && echo "; exec = "test -e /sys/class/power_supply/BAT*/capacity && echo ";
tooltip = false;
}; };
}; };
} }

View file

@ -30,10 +30,10 @@ in {
ryzenadj ryzenadj
]; ];
script = '' script = ''
ryzenadj --tctl-temp=50 ryzenadj --tctl-temp=55
while true; do while true; do
sleep 60 sleep 60
ryzenadj --tctl-temp=50 &> /dev/null ryzenadj --tctl-temp=55 &> /dev/null
done done
''; '';
}; };
@ -52,6 +52,7 @@ in {
]; ];
script = '' script = ''
old=0 old=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)
value=0 value=0
@ -65,15 +66,24 @@ in {
elif [ $temp -gt 50000 ] elif [ $temp -gt 50000 ]
then value=46 then value=46
elif [ $temp -gt 45000 ] elif [ $temp -gt 45000 ]
then value=23 then value=46
# then value=23
else value=0
fi fi
if [[ $old != $value ]]; then if [[ $old != $value ]]; then
old=$value # 30 = 60s smooth.
printf "%s: %d\n" "New fan speed" $value if [[ $value -lt $old ]] && [[ $smooth -lt 30 ]]; then
smooth=$((smooth+1))
else
old=$value
smooth=0
wm2fc $value
fi
else
smooth=0
fi fi
wm2fc $value &> /dev/null
sleep 2 sleep 2
done done
''; '';

View file

@ -1,4 +1,5 @@
# SRC: https://github.com/matega/win-max-2-fan-control # SRC: https://github.com/matega/win-max-2-fan-control
# NOTE: Speeds are from 0 to 184 (23 int). "a" for auto (disable).
{ {
autoPatchelfHook, autoPatchelfHook,
fetchFromGitHub, fetchFromGitHub,