dotfiles/thinkfan-confgen

30 lines
413 B
Plaintext
Raw Normal View History

2018-10-16 14:23:35 +00:00
#!/usr/bin/env bash
set -o errexit
2018-10-16 14:33:22 +00:00
set -o pipefail
2018-10-16 14:23:35 +00:00
main() {
2018-10-16 14:33:22 +00:00
if [[ -f "${1}" ]]; then
exec 1>"${1}"
fi
printf "# thinkfan-confgen created %s\n" "$(date -u)"
2018-10-16 14:23:35 +00:00
find /sys -type f -name 'temp*_input' | while read -r line; do
echo "hwmon ${line}"
done
cat <<'EOF'
tp_fan /proc/acpi/ibm/fan
(0, 0, 43)
(1, 41, 46)
(2, 44, 49)
(3, 47, 52)
(4, 50, 55)
(5, 53, 58)
(7, 56, 32767)
EOF
}
main "${@}"