mirror of
https://codeberg.org/gigirassy/niri-dotfiles
synced 2026-08-30 15:19:32 +00:00
update fanboost
This commit is contained in:
@@ -3,13 +3,23 @@
|
|||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
temp=$(cat /sys/class/thermal/thermal_zone*/temp | sort -nr | head -1)
|
temp=0
|
||||||
|
|
||||||
if [ "$temp" -ge 55000 ]; then
|
for f in /sys/class/thermal/thermal_zone*/temp; do
|
||||||
echo 1 > /sys/class/thermal/cooling_device*/cur_state
|
[ -r "$f" ] || continue
|
||||||
else
|
read -r t < "$f"
|
||||||
echo 0 > /sys/class/thermal/cooling_device*/cur_state
|
[ "$t" -gt "$temp" ] && temp=$t
|
||||||
fi
|
done
|
||||||
|
|
||||||
sleep 5
|
if [ "$temp" -ge 55000 ]; then
|
||||||
|
state=1
|
||||||
|
else
|
||||||
|
state=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
for f in /sys/class/thermal/cooling_device*/cur_state; do
|
||||||
|
[ -w "$f" ] && printf '%s\n' "$state" > "$f"
|
||||||
|
done
|
||||||
|
|
||||||
|
sleep 5
|
||||||
done
|
done
|
||||||
Reference in New Issue
Block a user