-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfan
executable file
·38 lines (35 loc) · 990 Bytes
/
fan
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# script for setting fan speed on asus laptops (FX504)
usage() {
echo "Usage: $0 [performance|turbo|silent] or $0 [p|t|s]"
}
# set fan speed
if [ ! -z $1 ]; then
if [ $1 = "p" ] || [ $1 = "performance" ]; then
# to performance
cd /sys/devices/platform/asus-nb-wmi
sudo sh -c "echo 0 >> fan_boost_mode"
cd - > /dev/null
elif [ $1 = "t" ] || [ $1 = "turbo" ]; then
# to turbo
cd /sys/devices/platform/asus-nb-wmi
sudo sh -c "echo 1 >> fan_boost_mode"
cd - > /dev/null
elif [ $1 = "s" ] || [ $1 = "silent" ]; then
# to silent
cd /sys/devices/platform/asus-nb-wmi
sudo sh -c "echo 2 >> fan_boost_mode"
cd - > /dev/null
else
usage
fi
fi
# show current fan speed
export FAN=$(cat /sys/devices/platform/asus-nb-wmi/fan_boost_mode);
if [ $FAN -eq 0 ]
then echo "Fan Mode: performance (balanced)"
elif [ $FAN -eq 1 ]
then echo "Fan Mode: turbo (gaming)"
elif [ $FAN -eq 2 ]
then echo "Fan Mode: silent (quiet)"
fi