Created
March 31, 2016 07:41
-
-
Save presianbg/9c0fa217327f8110bc61a24090db718c to your computer and use it in GitHub Desktop.
dynamic thermald fan detection
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
| cat /etc/rc.d/rc.local | |
| #!/bin/bash | |
| /root/fan_check.py | |
| exit 0 | |
| cat /root/fan_check.py | |
| #!/usr/bin/python3 | |
| import os | |
| import sys | |
| import fileinput | |
| def change_path(find_word, replace_with): | |
| for line in fileinput.FileInput("/etc/thermald/thermal-conf.xml", inplace=1): | |
| line = line.replace(find_word, replace_with) | |
| sys.stdout.write(line) | |
| if (os.path.isdir("/sys/devices/platform/asus-nb-wmi/hwmon/hwmon1")): | |
| change_path('hwmon2', 'hwmon1') | |
| else: | |
| change_path('hwmon1', 'hwmon2') | |
| cat /usr/lib/systemd/system/thermald.service | |
| [Unit] | |
| Description=Thermal Daemon Service | |
| After=rc-local.service | |
| [Service] | |
| Type=dbus | |
| SuccessExitStatus=1 | |
| BusName=org.freedesktop.thermald | |
| ExecStart=/usr/sbin/thermald --no-daemon --dbus-enable | |
| [Install] | |
| WantedBy=multi-user.target | |
| Alias=dbus-org.freedesktop.thermald.service | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment