configs  Check-in [e96bea889a]

Overview
Comment:Add cycle_asus_fan.sh
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e96bea889aed264974faa574ccf5023142d7ec24829435e8f93fa26e6b416ff1
User & Date: js on 2021-03-29 23:01:47
Other Links: manifest | tags
Context
2021-04-05
20:06
zshrc: Add uart command check-in: bd77a10bc6 user: js tags: trunk
2021-03-29
23:01
Add cycle_asus_fan.sh check-in: e96bea889a user: js tags: trunk
2021-03-27
12:14
zshrc: Work around gnupg agent path on Fedora check-in: 1990236ded user: js tags: trunk
Changes

Added cycle_asus_fan.sh version [a5c7ec9b42].















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
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