diff options
author | Karel Kočí <cynerd@email.cz> | 2017-01-24 17:03:35 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-01-24 17:03:35 +0100 |
commit | 677e2db01071fbecfbbe684c51c1db7e21a142af (patch) | |
tree | 948189557d791949df280c1c0bdd13e5b13c18e9 | |
parent | 39cd1849ec86e687a07bdce4a486ef0da9753004 (diff) | |
download | myconfigs-677e2db01071fbecfbbe684c51c1db7e21a142af.tar.gz myconfigs-677e2db01071fbecfbbe684c51c1db7e21a142af.tar.bz2 myconfigs-677e2db01071fbecfbbe684c51c1db7e21a142af.zip |
Add new script asus-fan
This script is for explicit switching between full or automatic fan
control.
-rw-r--r-- | config/i3/config | 10 | ||||
-rwxr-xr-x | local/bin/asus-fan | 27 |
2 files changed, 36 insertions, 1 deletions
diff --git a/config/i3/config b/config/i3/config index 30609bc..cfd0ffe 100644 --- a/config/i3/config +++ b/config/i3/config @@ -164,6 +164,15 @@ mode "$displays" { } bindsym $mod+Shift+w mode "$displays" +set $asus-fan fan: (f)ull, (a)uto +mode "$asus-fan" { + bindsym f exec --no-startup-id sudo asus-fan full, mode "default" + bindsym a exec --no-startup-id sudo asus-fan auto, mode "default" + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+Shift+f mode "$asus-fan" + # resize window (you can also use the mouse for that) mode "resize" { # These bindings trigger as soon as you enter the resize mode @@ -187,7 +196,6 @@ mode "resize" { bindsym Return mode "default" bindsym Escape mode "default" } - bindsym $mod+r mode "resize" # Switch keyboard diff --git a/local/bin/asus-fan b/local/bin/asus-fan new file mode 100755 index 0000000..00337ba --- /dev/null +++ b/local/bin/asus-fan @@ -0,0 +1,27 @@ +#!/bin/sh +HWMON=/sys/devices/platform/asus-nb-wmi/hwmon/hwmon2 + +if [ "$(whoami)" != "root" ]; then + echo "Run $0 only with root privileges" + exit -1 +fi + +case "$1" in + -h|--help) + echo "Usage: $0 -h|full|auto" + echo "This script controls asus hwmon" + echo " full - Full throttle" + echo " auto - Automatic hardware control" + ;; + full) + echo 1 > $HWMON/pwm1_enable + echo 255 > $HWMON/pwm1 + ;; + auto) + echo 0 > $HWMON/pwm1_enable + ;; + *) + echo "Unknown or no option given!" + exit -2 + ;; +esac |