Last active
October 22, 2024 09:20
-
-
Save TomaszGasior/73f401116e34615a85553dc162f8d772 to your computer and use it in GitHub Desktop.
Custom fan speed for Dell Optiplex 7050 Micro on Fedora 37 with Intel Core i7-7700T
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export CPU_TEMP_THRESHOLD_FOR_FAN_SPEED_LOW=54 | |
export CPU_TEMP_THRESHOLD_FOR_FAN_SPEED_HIGH=68 | |
export SLEEP_TIME_SECS=10 | |
export GET_CPU_TEMP_FILE=/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp1_input | |
export SET_FAN_SPEED_FILE=/sys/devices/platform/dell_smm_hwmon/hwmon/hwmon*/pwm1 | |
export FAN_SPEED_OFF=0 | |
export FAN_SPEED_LOW=120 | |
export FAN_SPEED_HIGH=250 | |
while true; do | |
current_cpu_temp=$((`cat $GET_CPU_TEMP_FILE` / 1000)) | |
if (( $current_cpu_temp >= $CPU_TEMP_THRESHOLD_FOR_FAN_SPEED_LOW )); then | |
echo $FAN_SPEED_LOW > $SET_FAN_SPEED_FILE | |
if (( $current_cpu_temp >= $CPU_TEMP_THRESHOLD_FOR_FAN_SPEED_HIGH )); then | |
sleep 1 | |
echo $FAN_SPEED_HIGH > $SET_FAN_SPEED_FILE | |
fi | |
else | |
echo $FAN_SPEED_OFF > $SET_FAN_SPEED_FILE | |
fi | |
sleep $SLEEP_TIME_SECS | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Custom fan speed of Dell computer using i8k driver | |
[Service] | |
Type=simple | |
ExecStart=/usr/local/libexec/dell-custom-fan-speed | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options dell_smm_hwmon force=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dell_smm_hwmon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install files to:
dell-custom-fan-speed
→/usr/local/libexec
dell-custom-fan-speed.service
→/usr/local/lib/systemd/system
dell_smm_hwmon.conf
→/etc/modules-load.d
dell_smm_hwmon-force.conf
→/etc/modprobe.d
Enable with:
sudo systemctl daemon-reload; sudo systemctl enable dell-custom-fan-speed.service
sudo dracut --force
(rebuild initramfs)