Nvidia fanspeed adjustment

From Sidvind
Jump to: navigation, search

This is a simple script thats can lower or raise the speed of the fan on nvidia based graphic cards. Requires nvclock.

Usage[edit]

  • Lower speed by 10%: adjustspeed -10
  • Raise speed by 5%: adjustspeed 5
  • Set to stored speed: adjustspeed

Code: adjustspeed.sh (view, download)

  1.  #!/bin/bash
  2.  
  3.  if [ ! -e ~/.fanspeed ];
  4.  then
  5.          echo "Creating ~/.fanspeed with default speed (100%)"
  6.          echo "100" > ~/.fanspeed
  7.  fi
  8.  
  9.  speed=`cat ~/.fanspeed`
  10.  
  11.  if [ ! $1 ];
  12.  then
  13.          echo "Setting speed to stored value ($speed%)"
  14.          nvclock -F $speed -f
  15.          exit 0
  16.  else
  17.          diff=$1
  18.  fi
  19.  
  20.  speed=`expr $speed + $diff`
  21.  
  22.  if [ $speed -lt 30 ];
  23.  then
  24.          speed=30
  25.  fi
  26.  
  27.  if [ $speed -gt 100 ];
  28.  then
  29.          speed=100
  30.  fi
  31.  
  32.  nvclock -F $speed -f
  33.  pkill osd_cat
  34.  echo "$speed" > ~/.fanspeed
  35.  echo "Fanspeed: $speed%" | \osd_cat -f "-*-courier-bold-r-normal-*-34-*-*-*-*-*-*-*" -o 50 -p top -A center -d 2