Add cycle_asus_fan.sh
This commit is contained in:
parent
e36d1afffa
commit
38649bf520
1 changed files with 39 additions and 0 deletions
39
cycle_asus_fan.sh
Executable file
39
cycle_asus_fan.sh
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Small script to change the performance / fan mode on ASUS laptops and display
|
||||||
|
# a notification about it. Can be bound to the fan key of the keyboard in e.g.
|
||||||
|
# GNOME.
|
||||||
|
# Requires /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy to be owned
|
||||||
|
# by the user, e.g. by putting into /etc/tmpfiles.d/asus_fan_perms.conf:
|
||||||
|
# z /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy 664 root js - -
|
||||||
|
# (Replace js with the primary group of your user)
|
||||||
|
#
|
||||||
|
|
||||||
|
file="/sys/devices/platform/asus-nb-wmi/throttle_thermal_policy"
|
||||||
|
current="$(<$file)"
|
||||||
|
new="$(((current + 1) % 3))"
|
||||||
|
|
||||||
|
if ! echo "$new" >"$file"; then
|
||||||
|
notify-send -i dialog-error -c device \
|
||||||
|
"Performance Control" \
|
||||||
|
"Failed to change performance profile."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$new" in
|
||||||
|
0)
|
||||||
|
notify-send -i power-profile-balanced -c device \
|
||||||
|
"Performance Control" \
|
||||||
|
"Performance profile changed to normal."
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
notify-send -i power-profile-performance -c device \
|
||||||
|
"Performance Control" \
|
||||||
|
"Performance profile changed to turbo."
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
notify-send -i power-profile-power-saver -c device \
|
||||||
|
"Performance Control" \
|
||||||
|
"Performance profile changed to quiet."
|
||||||
|
;;
|
||||||
|
esac
|
Loading…
Add table
Add a link
Reference in a new issue